We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want to count the number of reads for the mutation T>C, I used the following code:
query_seq = read.query_sequence ref_seq = reference.fetch(read.reference_name, read.reference_start, read.reference_end) alignments = read.get_aligned_pairs(matches_only=True, with_seq=True) for query_pos, ref_pos, ref_base in alignments: if ref_base.upper() == 'T' and query_seq[query_pos].upper() == 'C': tc_count += 1 print(query_seq) print(ref_seq) break
Output: CATTTCTTAGTCCTACACACTAAAAACAGTAATGTGCTGCTTTGAGTGTGTAGGACTAAGAAATGGGATTCAGAGTAGTAAAGAGAAAAGTGGAATTTCCAAGCACTATGAATTACTGTTCTTTAAAAAACAGCAAAAATC
ACTTTAAAAACAGTAATGTGCTGCTTTGAGTGTGTAGGACTAAGAAATGGGATTCAGAGTAGTAAAGAGAAAAGTGGAATTTCCAAGCACTATGAATTACTGTTCTTTAAAAAACAGCAAAAATC
I set matches_only=True. Normally, tccount is always equal to 0. Why are their lengths different? causing tccount to increase
The text was updated successfully, but these errors were encountered:
If matches_only=True is set, will only the exact same base pairs be returned? How should I change the code to count the number of reads with t>C?
Sorry, something went wrong.
No branches or pull requests
I want to count the number of reads for the mutation T>C, I used the following code:
Output:
CATTTCTTAGTCCTACACACTAAAAACAGTAATGTGCTGCTTTGAGTGTGTAGGACTAAGAAATGGGATTCAGAGTAGTAAAGAGAAAAGTGGAATTTCCAAGCACTATGAATTACTGTTCTTTAAAAAACAGCAAAAATC
ACTTTAAAAACAGTAATGTGCTGCTTTGAGTGTGTAGGACTAAGAAATGGGATTCAGAGTAGTAAAGAGAAAAGTGGAATTTCCAAGCACTATGAATTACTGTTCTTTAAAAAACAGCAAAAATC
I set matches_only=True. Normally, tccount is always equal to 0. Why are their lengths different? causing tccount to increase
The text was updated successfully, but these errors were encountered: