Skip to content

Commit

Permalink
JBrowse2: Revert from pif indexes for paf (#1522)
Browse files Browse the repository at this point in the history
* 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...

* cleanup master branch of fork

* Idiotic sort error generates broken pif indexes.
Pity the built in fails in biocontainers.

* problem with pif
revert to paf until sorted

* return to using paf unindexed until figure out why the jbrowse utility is broken
tabix does not do this.

* remove tabix code - won't work.

* remove debug ls

* flake8
  • Loading branch information
fubar2 authored Oct 17, 2024
1 parent c994ad3 commit b76c8cc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
20 changes: 13 additions & 7 deletions tools/jbrowse2/jbrowse2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,18 +1130,24 @@ def add_bed(self, data, ext, trackData):
self.trackIdlist.append(tId)

def add_paf(self, data, trackData, pafOpts, **kwargs):
canPIF = False
tname = trackData["name"]
tId = trackData["label"]
url = tId
usePIF = False # much faster if indexed remotely or locally
usePIF = False # much faster if indexed remotely or locally but broken in biocontainer.
useuri = data.startswith("http://") or data.startswith("https://")
if not useuri:
url = "%s.pif.gz" % tId
cmd = "sort -b -k1,1 -k2,3n -k3,4n '%s' | bgzip -c > '%s'" % (data, url)
self.subprocess_popen(cmd)
cmd = ["tabix", "-b", "3", "-e", "4", "-f", url]
self.subprocess_check_call(cmd)
usePIF = True
if canPIF:
fakeName = '%s.paf' % tId
url = "%s.pif.gz" % tId
cmd = ["cp", data, fakeName]
self.subprocess_check_call(cmd)
cmd = ["jbrowse", "make-pif", fakeName] # jbrowse pif input.paf --out output.pif.gz # specify output file, creates output.pif.gz.tbi also
self.subprocess_check_call(cmd)
usePIF = True
else:
dest = os.path.join(self.outdir, url)
self.symlink_or_copy(os.path.realpath(data), dest)
else:
url = data
if data.endswith(".pif.gz") or data.endswith(".paf.gz"): # is tabix
Expand Down
17 changes: 10 additions & 7 deletions tools/jbrowse2/jbrowse2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -666,11 +666,16 @@ export JBROWSE2_PATH=\$(realpath \$(dirname \$(which jbrowse))/../opt/jbrowse2)
<has_archive_member path="merlinlastz.maf_6.sorted.bed.gz.tbi"/>
<has_archive_member path="merlin.blastxml_7.gz"/>
<has_archive_member path="dm3test.cool_9.hic"/>
<has_archive_member path="peach-grape-map.paf_10.pif.gz"/>
<has_archive_member path="peach-grape-map.paf_10.pif.gz.tbi"/>
<has_archive_member path="peach-grape-map.paf_10"/>
<has_archive_member path="arabgrapepeach.paf_11"/>
<has_archive_member path="arabgrapepeach.paf_11.pif.gz"/>
<has_archive_member path="arabgrapepeach.paf_11.pif.gz.tbi"/>
<has_archive_member path="Merlin.fa.gz.fai"/>
<has_archive_member path="dm3.fa.fa.gz.fai"/>
<has_archive_member path="Ppersica1.fa.fa.gz"/>
<has_archive_member path="Ppersica1.fa.fa.gz.fai"/>
<has_archive_member path="Ppersica1.fa.fa.gz.gzi"/>
<has_archive_member path="Vvinifera1.fa.fa.gz.fai"/>
<has_archive_member path="Vvinifera1.fa.fa.gz"/>
<has_archive_member path="Vvinifera1.fa.fa.gz.gzi"/>
<has_archive_member path="Merlin.fa.gz.fai"/>
<has_archive_member path="dm3.fa.fa.gz.fai"/>
<has_archive_member path="Ppersica1.fa.fa.gz"/>
Expand All @@ -680,9 +685,7 @@ export JBROWSE2_PATH=\$(realpath \$(dirname \$(which jbrowse))/../opt/jbrowse2)
<has_archive_member path="Vvinifera1.fa.fa.gz"/>
<has_archive_member path="Vvinifera1.fa.fa.gz.gzi"/>
<has_archive_member path="config.json">
<has_json_property_with_text property="type" text="PairwiseIndexedPAFAdapter"/>
<has_json_property_with_text property="uri" text="peach-grape-map.paf_10.pif.gz.tbi"/>
<has_json_property_with_text property="uri" text="peach-grape-map.paf_10.pif.gz"/>
<has_json_property_with_text property="uri" text="Vvinifera1.fa.fa.gz.fai"/>
</has_archive_member>
</assert_contents>
</output>
Expand Down
2 changes: 1 addition & 1 deletion tools/jbrowse2/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</requirements>
</xml>
<token name="@DATA_DIR@">\$GALAXY_JBROWSE_SHARED_DIR</token>
<token name="@VERSION_SUFFIX@">5</token>
<token name="@VERSION_SUFFIX@">6</token>
<xml name="creators">
<creator>
<person givenName="Helena" familyName="Rasche" url="https://github.com/hexylena"/>
Expand Down

0 comments on commit b76c8cc

Please sign in to comment.