Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
hack to print out qualities in cutadapt’s info file (will crash when trimming FASTA files)
diff --git i/cutadapt/scripts/cutadapt.py w/cutadapt/scripts/cutadapt.py
index 855721d..2eaf435 100755
--- i/cutadapt/scripts/cutadapt.py
+++ w/cutadapt/scripts/cutadapt.py
@@ -155,6 +155,7 @@ class AdapterCutter(object):
# TODO write only one line, even for multiple matches
for match in matches:
seq = match.read.sequence
+ qualities = match.read.qualities
if match is None:
print(match.read.name, -1, seq, sep='\t', file=self.info_file)
else:
@@ -167,6 +168,9 @@ class AdapterCutter(object):
seq[match.rstart:match.rstop],
seq[match.rstop:],
match.adapter.name,
+ qualities[0:match.rstart],
+ qualities[match.rstart:match.rstop],
+ qualities[match.rstop:],
sep='\t', file=self.info_file
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.