Skip to content

Instantly share code, notes, and snippets.

@StephenFordham
Created April 8, 2019 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StephenFordham/bf4c3fc77fa5117fb81145b6ceda7485 to your computer and use it in GitHub Desktop.
Save StephenFordham/bf4c3fc77fa5117fb81145b6ceda7485 to your computer and use it in GitHub Desktop.
RegexCombined
import re
htt_pattern = '(CAG|CAA){18,}'
htt_mRNA = open('C:/Users/apsciuser/Downloads/htt_gene.fasta').read()
match = re.findall(htt_pattern, htt_mRNA)
print("The number of polyQ repeats found are: " + str(len(match)))
# Console output
# The number of polyQ repeats found are: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment