-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read comment #4
Comments
Also on that note is there a function to write the complete read back to file, something like:
This will write the sequence, but not the complete read. |
Here is simple Python function for now: def build_read_string(read, fastq: bool = False, comment: str = None):
""" Build read string from pyfastx read """
if fastq:
return f"@{read.name}{' '+comment if comment else ''}" \
f"\n{read.seq}\n+\n{read.qual}"
else:
return f">{read.name}\n{read.seq}" |
Good suggestion! In later versions, I will consider adding a ".raw" attribution to read and sequence object to get raw string as it appeared in file. But I am not sure if the read comment is important. In many fastq files, the comment line only contains a '+' char. |
Thanks that's great to hear! I was imprecise when I said comment, which was a reference to the
In this case it would be useful to be able to access the string after the |
Hey nice tool - quite useful to extend
pyfaidx
toFastq
. Is there any chance you could implement to read the comment on a read header?Currently the only accessible attribute is
read.name
when iterating overpyfastx.Fastq
The text was updated successfully, but these errors were encountered: