GMOD / jbrowse

JBrowse 1, a full-featured genome browser built with JavaScript and HTML5. For JBrowse 2, see https://github.com/GMOD/jbrowse-components.
http://jbrowse.org
Other
460 stars 199 forks source link

remove forward and back slashes from chunk filenames when formatting … #1585

Closed rbuels closed 3 years ago

rbuels commented 3 years ago

this PR fixes formatting of reference sequences when the names have forward slashes or backslashes in them.

references gitter convo:

image

cmdcolin commented 3 years ago

@rbuels we might need to do the same for gff

if I run on a gff

$ bin/flatfile-to-json.pl --gff test.gff --trackLabel testing
Unsuccessful stat on filename containing newline at /home/cdiesh/src/gmod/jbrowse/bin/../src/perl5/FeatureTrack.pm line 70.
Unsuccessful stat on filename containing newline at /home/cdiesh/src/gmod/jbrowse/bin/../src/perl5/JsonFileStorage.pm line 64.

test.gff

hi/I/have/slashes   SwinePathogenAnalysisResource(SPAR) mat_peptide 1   100 .   +   0   ID=GB000440/KU318406.1/A2MC2-P90/USA/2-5-2:nsp10;Name=nsp10;ORF1ab-gene;Note=full
cmdcolin commented 3 years ago

actually nevermind, seems to work :)

rbuels commented 3 years ago

maybe should escape newlines too, i'll add that

btski commented 3 years ago

Fix works great. Thanks!

cmdcolin commented 3 years ago

nice. we can go ahead and merge :)

rbuels commented 3 years ago

just thought of something, the JS code probably needs to be updated to match, right?

cmdcolin commented 3 years ago

looked ok to me without any additional changes, not sure what js you mean though?

rbuels commented 3 years ago

the JS code probably needs to do the same regex replace, in order to be able to find the munged paths for the chunk files

cmdcolin commented 3 years ago

didn't appear to be needed as far as I could tell, did this on this branch

bin/prepare-refseqs.pl --fasta tests/data/forward_slashes_in_refseq_name.fa

and then opening up http://localhost/jbrowse worked fine without any additional changes

cmdcolin commented 3 years ago

JBrowse-1.16.12-alpha.0.zip

cmdcolin commented 3 years ago

I uploaded above @btski a build that includes this fix plus the fixed refseq on dev just in case it helps :)