Skip to content

Commit

Permalink
Don't modify SAM headers
Browse files Browse the repository at this point in the history
fixes #18
  • Loading branch information
karel-brinda committed Feb 26, 2018
1 parent 3331b32 commit 4dcb6ef
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions samsift/samsift.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,17 +265,17 @@ def run(self):
#print("@PG", "ID:{}".format(PROGRAM), "PN:{}".format(PROGRAM), "VN:{}".format(VERSION), "CL:{}".format(" ".join(sys.argv)), sep="\t")
header=in_sam.header

pg={
"ID":PROGRAM,
"PN":PROGRAM,
"VN":VERSION,
"CL":" ".join(map(lambda x:"'{}'".format(x),sys.argv)),
}

try:
header['PG'].insert(0,pg)
except KeyError:
header['PG']=[pg]
#pg={
# "ID":PROGRAM,
# "PN":PROGRAM,
# "VN":VERSION,
# "CL":" ".join(map(lambda x:"'{}'".format(x),sys.argv)),
# }

#try:
# header['PG'].insert(0,pg)
#except KeyError:
# header['PG']=[pg]

with pysam.AlignmentFile(self.out_sam_fn, self.pysam_out_mode, header=header) as out_sam:
self.out_sam=out_sam
Expand Down

0 comments on commit 4dcb6ef

Please sign in to comment.