Fix random order of fasta headers in maf_to_bed

This commit is contained in:
mvdbeek
2018-09-05 14:22:01 +02:00
parent f22f0ebb2f
commit e8d0ce39cf
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -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
+1 -1
View File
@@ -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"/>