Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two bugs with split_file_to_collection #1358

Merged
merged 2 commits into from
Nov 23, 2023
Merged

Conversation

simonbray
Copy link
Collaborator

Allow chunksize to be greater than the number of records in the input file without raising the following error:

Traceback (most recent call last):
  File "/srv/galaxy/var/shed_tools/toolshed.g2.bx.psu.edu/repos/bgruening/split_file_to_collection/6cbe2f30c2d7/split_file_to_collection/split_file_to_collection.py", line 281, in <module>
    main()
  File "/srv/galaxy/var/shed_tools/toolshed.g2.bx.psu.edu/repos/bgruening/split_file_to_collection/6cbe2f30c2d7/split_file_to_collection/split_file_to_collection.py", line 52, in main
    split_by_record(args, in_file, out_dir, top, ftype)
  File "/srv/galaxy/var/shed_tools/toolshed.g2.bx.psu.edu/repos/bgruening/split_file_to_collection/6cbe2f30c2d7/split_file_to_collection/split_file_to_collection.py", line 169, in split_by_record
    new_file = open(newfile_names[new_file_counter], "a")
IndexError: list index out of range

Allow an empty file to be split without raising the following error:

Traceback (most recent call last):
  File "/srv/galaxy/var/shed_tools/toolshed.g2.bx.psu.edu/repos/bgruening/split_file_to_collection/6cbe2f30c2d7/split_file_to_collection/split_file_to_collection.py", line 281, in <module>
    main()
  File "/srv/galaxy/var/shed_tools/toolshed.g2.bx.psu.edu/repos/bgruening/split_file_to_collection/6cbe2f30c2d7/split_file_to_collection/split_file_to_collection.py", line 52, in main
    split_by_record(args, in_file, out_dir, top, ftype)
  File "/srv/galaxy/var/shed_tools/toolshed.g2.bx.psu.edu/repos/bgruening/split_file_to_collection/6cbe2f30c2d7/split_file_to_collection/split_file_to_collection.py", line 141, in split_by_record
    if sep_at_end and not last_line_matched:
UnboundLocalError: local variable 'last_line_matched' referenced before assignment

* allow chunksize to be greater than the number of records in the input file without failing
* allow an empty file to be split without an error
@bgruening bgruening merged commit 37305ce into master Nov 23, 2023
10 checks passed
@bgruening bgruening deleted the simonbray-patch-1 branch November 23, 2023 19:48
sunyi000 pushed a commit to sunyi000/galaxytools that referenced this pull request Feb 28, 2024
* fix two bugs

* allow chunksize to be greater than the number of records in the input file without failing
* allow an empty file to be split without an error

* bump version number
bgruening added a commit that referenced this pull request Feb 29, 2024
* woundhealing tool

* added gitlab citation

* fixing typo

* remove unwanted file

* add .shed.yml

* added location tag in tests

* clean test data

* update shed.yml

* Fix two bugs with `split_file_to_collection` (#1358)

* fix two bugs

* allow chunksize to be greater than the number of records in the input file without failing
* allow an empty file to be split without an error

* bump version number

* Update Nanopolish to v0.14 (#1359)

* fix lint error + version upgrade

* Explicit untar of .tar.xz

* Adapt tests to multithreading and code refactoring

* Add RBPBench tool wrapper (#1360)

* add wrapper files

* add macros

* modify select_rbps command

* add fasta_indexes.loc

* fix data_table and genome fasta path

* new conda version with wrapper script

* new conda version with wrapper script

* remove python_template_version

---------

Co-authored-by: Pavankumar Videm <[email protected]>

* update rbpbench tool-data conf (#1362)

* Add palette options to convert (#1364)

* tool to query ftplinks from bioimage archive (#1345)

* added tool to query ftplink from bia

* multiple values

* add help

* add .shed.yml;remove multiple from param

* remove wrong file

* updates to the tool

* Update biaftplink.xml

* Update .shed.yml

* Update biaftplink.xml

---------

Co-authored-by: Yi Sun <[email protected]>
Co-authored-by: Björn Grüning <[email protected]>

* update v08 to fix meme version check error (#1366)

* add mavedb data source tool (#1367)

* add mavedb data source tool

* Rename shed.yml to .shed.yml

* change category

* remove duplicate category

* change tool ID to mavedb_importer

* Update tools/mave_tools/mavedb/.shed.yml

* Update mavedb.xml

---------

Co-authored-by: Björn Grüning <[email protected]>

* Change query params according mavedb requirements (#1368)

* add mavedb data source tool

* Rename shed.yml to .shed.yml

* change category

* remove duplicate category

* change tool ID to mavedb_importer

* Update tools/mave_tools/mavedb/.shed.yml

* Update mavedb.xml

* change param names for mavedb requirements

* remove comment

---------

Co-authored-by: Björn Grüning <[email protected]>
Co-authored-by: Björn Grüning <[email protected]>

* update to v081 (#1369)

* gm updates (#1373)

* gm updates

* fix linting

* Update compare.xml

* Integrate another bioMLmodel (biomd0000001076) (#1371)

* Add tool BIOMD0000001076

* update tool desc

* update tool desc

* add version

* update

* update test

* remove print

* add creator

* update tool

* update doi

* Update tools/biomodelsML/biomodels_BIOMD0000001076.xml

Co-authored-by: Björn Grüning <[email protected]>

* remove xlsx

* test bibtext to fix test

* revert to type=doi

* remove creator tag

* update profile

* update embedded script name

---------

Co-authored-by: Björn Grüning <[email protected]>

* fix typo in param documentation (#1374)

* bump intarna 3.4.0 (#1378)

* Updating tools/cpat from version 3.0.4 to 3.0.5 (#1379)

Co-authored-by: planemo-autoupdate <[email protected]>

* Updating tools/image_processing/graphicsmagick from version 1.3.40 to 1.3.42 (#1380)

Co-authored-by: planemo-autoupdate <[email protected]>

* Cool to hic (#1382)

* adding first tested and working generated tool from https://github.com/fubar2/nftoolmaker
It actually does work. Sort of.
Hope this is useful to someone.

* fixes suggested by bgruening for the PR - all adjustments will now apply to all future generated tools :)

* add yara mapper ToolFactory - NOT from nf-core.
Allows single ended fastq or fasta to be mapped, or a pair of forward and reverse - both must be fastq

* small test files still work :)

* single quotes for $runme - disappeared mysteriously :(

* adding panaroo

* Finally fixed the '$runme' suggestion and got the sanitisers not to.

* fix profile="22.05" - need to update galaxyxml to fix this and the stdio replacement...

* cool_to_hic tool

* add cool_to_hic

* cleanup other branch

* fix bogus gfastats fix

* fix gfastats

* and again

* fix yaml

* fix so allows cool/mcool/scool - untested as I got no data...

* need test data.

* fixes from review

* fix bogus help transition

* Update .shed.yml

* some small cleanups

* Update .shed.yml

* lets call it juicebox_hic

---------

Co-authored-by: Björn Grüning <[email protected]>

* Add juicebox_hic format and citation (#1383)

* adding first tested and working generated tool from https://github.com/fubar2/nftoolmaker
It actually does work. Sort of.
Hope this is useful to someone.

* fixes suggested by bgruening for the PR - all adjustments will now apply to all future generated tools :)

* add yara mapper ToolFactory - NOT from nf-core.
Allows single ended fastq or fasta to be mapped, or a pair of forward and reverse - both must be fastq

* small test files still work :)

* single quotes for $runme - disappeared mysteriously :(

* adding panaroo

* Finally fixed the '$runme' suggestion and got the sanitisers not to.

* fix profile="22.05" - need to update galaxyxml to fix this and the stdio replacement...

* add citation and link to github
add juicebox_hic as the name of the output

* fix branch again

* update CI

* Add TAPscan (#1357)

* add tapscan tool

* update shed file for this repo

* add edam topic and creator

* compress domains file

* AGAT - Add new feature (functional annotation) (#1377)

* add new feature

* small modifications

* some modification

* small changes

* small modifications

* small modification

* small modification

---------

Co-authored-by: Bjoern Gruening <[email protected]>

* update CI

* update CI

* Tapscan update (#1388)

* add new updated tapscan files

* update wrapper and test data

* change fiji-mopholibj version

* small cleanups

* Update woundhealing.xml

---------

Co-authored-by: Yi Sun <[email protected]>
Co-authored-by: Simon Bray <[email protected]>
Co-authored-by: Tunc Kayikcioglu <[email protected]>
Co-authored-by: Michael Uhl <[email protected]>
Co-authored-by: Pavankumar Videm <[email protected]>
Co-authored-by: Helena <[email protected]>
Co-authored-by: Björn Grüning <[email protected]>
Co-authored-by: Polina Polunina <[email protected]>
Co-authored-by: Björn Grüning <[email protected]>
Co-authored-by: Anup Kumar <[email protected]>
Co-authored-by: Linelle <[email protected]>
Co-authored-by: Martin Raden <[email protected]>
Co-authored-by: gxydevbot <[email protected]>
Co-authored-by: planemo-autoupdate <[email protected]>
Co-authored-by: Ross Lazarus <[email protected]>
Co-authored-by: Saskia Hiltemann <[email protected]>
Co-authored-by: Rlibouban <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants