mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix to sam2interval bug reported by Kathy So. The bug was causing sam2interval to successfully parse unmapped sam entries, which have no valid coordinate.
This commit is contained in:
@@ -93,10 +93,12 @@ options (listed below) default to 'None' if omitted
|
||||
read_name = fields[ int( options.read_col ) - 1 ]
|
||||
ref_name = fields[ int( options.ref_col ) - 1 ]
|
||||
|
||||
if options.prt_all:
|
||||
print '%s\t%s\t%s\t%s\t%s' % (ref_name, str(start), str(end+start), strand, line)
|
||||
else:
|
||||
print '%s\t%s\t%s\t%s' % (ref_name, str(start), str(end+start), strand)
|
||||
if not ref_name == '*':
|
||||
# Do not print lines with unmapped reads that contain '*' instead of chromosome name
|
||||
if options.prt_all:
|
||||
print '%s\t%s\t%s\t%s\t%s' % (ref_name, str(start), str(end+start), strand, line)
|
||||
else:
|
||||
print '%s\t%s\t%s\t%s' % (ref_name, str(start), str(end+start), strand)
|
||||
|
||||
if __name__ == "__main__": main()
|
||||
|
||||
|
||||
@@ -23,6 +23,11 @@
|
||||
<param name="print_all" value="No"/>
|
||||
<output name="out_file1" file="sam2interval_noprintAll.dat" ftype="interval"/>
|
||||
</test>
|
||||
<test>
|
||||
<param name="input1" value="sam2interval-test3.sam" ftype="sam"/>
|
||||
<param name="print_all" value="No"/>
|
||||
<output name="out_file1" file="sam2interval_with_unmapped_reads_noprintAll.dat" ftype="interval"/>
|
||||
</test>
|
||||
|
||||
</tests>
|
||||
<help>
|
||||
|
||||
Reference in New Issue
Block a user