mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
Fix random order of fasta headers in maf_to_bed
This commit is contained in:
@@ -6,6 +6,7 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
from collections import OrderedDict
|
||||
|
||||
from bx.align import maf
|
||||
|
||||
@@ -23,14 +24,15 @@ def __main__():
|
||||
primary_spec = None
|
||||
|
||||
if "None" in species:
|
||||
species = set()
|
||||
species = OrderedDict()
|
||||
try:
|
||||
for i, m in enumerate(maf.Reader(open(input_filename, 'r'))):
|
||||
for c in m.components:
|
||||
spec, chrom = maf.src_split(c.src)
|
||||
if not spec or not chrom:
|
||||
spec = chrom = c.src
|
||||
species.add(spec)
|
||||
spec = c.src
|
||||
species[spec] = None
|
||||
species = species.keys()
|
||||
except Exception:
|
||||
print("Invalid MAF file specified", file=sys.stderr)
|
||||
return
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</outputs>
|
||||
<tests>
|
||||
<test>
|
||||
<param name="input1" value="4.maf"/>
|
||||
<param name="input1" value="4.maf" ftype="maf"/>
|
||||
<param name="species" value="hg17"/>
|
||||
<param name="complete_blocks" value="partial_disallowed"/>
|
||||
<output name="out_file1" file="cf_maf_to_bed.dat"/>
|
||||
|
||||
Reference in New Issue
Block a user