details: http://www.bx.psu.edu/hg/galaxy/rev/7163a2128267 changeset: 3338:7163a2128267 user: Dan Blankenberg <dan@bx.psu.edu> date: Fri Feb 05 11:53:06 2010 -0500 description: Have sam2interval provide a (partial) header so that strand is automatically set in metadata. diffstat: test-data/sam2interval_noprintAll.dat | 1 + test-data/sam2interval_printAll.dat | 1 + tools/samtools/sam2interval.py | 2 ++ 3 files changed, 4 insertions(+), 0 deletions(-) diffs (28 lines): diff -r 8b3c1f064bef -r 7163a2128267 test-data/sam2interval_noprintAll.dat --- a/test-data/sam2interval_noprintAll.dat Fri Feb 05 11:49:51 2010 -0500 +++ b/test-data/sam2interval_noprintAll.dat Fri Feb 05 11:53:06 2010 -0500 @@ -1,3 +1,4 @@ +#chrom start end strand ref 6 22 + ref 8 19 + ref 8 14 + diff -r 8b3c1f064bef -r 7163a2128267 test-data/sam2interval_printAll.dat --- a/test-data/sam2interval_printAll.dat Fri Feb 05 11:49:51 2010 -0500 +++ b/test-data/sam2interval_printAll.dat Fri Feb 05 11:53:06 2010 -0500 @@ -1,3 +1,4 @@ +#chrom start end strand ref 6 22 + r001 163 ref 7 30 8M2I4M1D3M = 37 39 TTAGATAAAGGATACTA * ref 8 19 + r002 0 ref 9 30 3S6M1P1I4M * 0 0 AAAAGATAAGGATA * ref 8 14 + r003 0 ref 9 30 5H6M * 0 0 AGCTAA * NM:i:1 diff -r 8b3c1f064bef -r 7163a2128267 tools/samtools/sam2interval.py --- a/tools/samtools/sam2interval.py Fri Feb 05 11:49:51 2010 -0500 +++ b/tools/samtools/sam2interval.py Fri Feb 05 11:53:06 2010 -0500 @@ -76,6 +76,8 @@ cigar = re.compile( '\d+M|\d+N|\d+D|\d+P' ) + print '#chrom\tstart\tend\tstrand' # provide a (partial) header so that strand is automatically set in metadata + for line in infile: line = line.rstrip( '\r\n' ) if line and not line.startswith( '#' ) and not line.startswith( '@' ) :