MATH564 Homework 8: Genomics

Topics

Structural genomics

Nucleobases

RNA

DNA

Import[#,"PDB"]&/@{"http://files.rcsb.org/download/5ET9.pdb","http://files.rcsb.org/download/1BNA.pdb","http://files.rcsb.org/download/208D.pdb","http://files.rcsb.org/download/1D91.pdb","http://files.rcsb.org/download/5A0W.pdb"}

BLAST

Smith-Waterman algorithm

Consider simple cases:
1. Identical strings

query="ABCDEFGHIJ"; subject="ABCDEFGHIJ";
Table[SmithWatermanSimilarity[StringTake[query,n],StringTake[subject,n]],{n,10}]

2. Replace a single character

For[p=1,p≤10,p++,subject=StringReplacePart["ABCDEFGHIJ","X",{p,p}];
Print[{query,subject,Table[SmithWatermanSimilarity[StringTake[query,n],StringTake[subject,n]],{n,10}]}]]

SmithWatermanSimilarity["ABCDEFGHIJ","ABCDXFGHIJ"]

Options[SmithWatermanSimilarity]

3. Replace multiple successive characters

For[p=1,p≤7,p++,subject=StringReplacePart["ABCDEFGHIJ","XYZ",{p,p+2}];
Print[{query,subject,Table[SmithWatermanSimilarity[StringTake[query,n],StringTake[subject,n]],{n,10}]}]]

3. Replace multiple characters at different positions

For[p=1,p≤8,p++,
subject=StringReplacePart["ABCDEFGHIJ","X",{{p,p},{p+2,p+2}}];
Print[{query,subject,Table[SmithWatermanSimilarity[StringTake[query,n],StringTake[subject,n]],{n,10}]}]]

For[p=1,p≤5,p++,
subject=StringReplacePart["ABCDEFGHIJ","X",{{p,p},{p+5,p+5}}];
Print[{query,subject,Table[SmithWatermanSimilarity[StringTake[query,n],StringTake[subject,n]],{n,10}]}]]

For[p=1,p≤5,p++,
subject=StringReplacePart["ABCDEFGHIJ","XY",{{p,p},{p+5,p+5}}];
Print[{query,subject,Table[SmithWatermanSimilarity[StringTake[query,n],StringTake[subject,n]],{n,10}]}]]

SmithWatermanSimilarity["ABC","XYB"]

query="CIMGAPART"; subject="LIDAFEGAMPAT";
SequenceAlignment[query,subject]

query="CIMGAPART"; subject="LIDAFEGAMPAT";
SequenceAlignment[query,subject,SimilarityRules->"BLAST"]

query="CIMGAPART"; subject="LIDAFEGAMPAT";
SequenceAlignment[query,subject,SimilarityRules->"PAM70"]

Options[SequenceAlignment]

NeedlemanWunschSimilarity[query,subject]

SmithWatermanSimilarity[query,subject]

Table[SmithWatermanSimilarity[StringTake[query,i],StringTake[subject,j]],{i,0,StringLength[query]},{j,0,StringLength[subject]}] // TableForm

Protein substitution matrix

Overlap of 3-mers: BIOSUM62, PAM250

SetDirectory[NotebookDirectory[]];
Mtable = Import["PAM.png"]

M1=Map[N[ToExpression[#]]&,TextRecognize[Mtable,"Word"]]

3. Replace multiple successive characters

Table[SmithWatermanSimilarity[StringTake[query,i],StringTake[subject,j],SimilarityRules->"BLOSUM62"],{i,0,StringLength[query]},{j,0,StringLength[subject]}] // TableForm

Table[SmithWatermanSimilarity[StringTake[query,i],StringTake[subject,j],SimilarityRules->"PAM70"],{i,0,StringLength[query]},{j,0,StringLength[subject]}] // TableForm

Malaria parasite

Malaria is caused by a uni-cellular organism named Plasmodium falciparum.

gICAM1=WolframAlpha["Plasmodium falciparum ICAM1 gene",{{"ReferenceSequence:GeneData",1},"ComputableData"}]

Comparison of ICAM1 gene across organisms

gICAM1Hsapiens=WolframAlpha["H. sapines ICAM1 gene",{{"ReferenceSequence:GeneData",1},"ComputableData"}][[2]]

gICAM1Mmusculus=WolframAlpha["M. musculus ICAM1 gene",{{"ReferenceSequence:GeneData",1},"ComputableData"}][[2]]

Manipulate[SmithWatermanSimilarity[StringTake[gICAM1Hsapiens,n],StringTake[gICAM1Mmusculus,n]],{n,1,40,1}]

FullGeneHsapiens=GenomeData["ICAM1"];

StringLength[FullGeneHsapiens]

FullGeneMmusculus ="GTGAGCCAGAGACTATAAAAGCGCCGCCCGCCTCAGTCTGCACCCAGTGCTAGTGCTGAGCTCCGCTGCTACCTGCACTTTGCCCTGGCCCTGCAATGGCTTCAACCCGTGCCAAGCCCACGCTACCTCTGCTCCTGGCC
CTGGTCACCGTTGTGATCCCTGGTGAGTCCG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C
TATGACTAATTGTGTCTAATGTTTTAGGTTTTTAAAAATAATCAATTTTTAGCCAGGCATGGTGGCGTAC
ACCTTTAATCCCAGCACTCGGGAGGCAGAGGCAGGAGGATTTCTGAGTTCGAGGCCAGCCTGGTCTACAA
AGTGAGTTCCAGGACAGCCAGGGCTACACAGAGAAACCCTGTCTTAAAAAAACCAAAAAAAGAAAAAAAG
TCAATTTTTTATTTTATGTGCATTAGTGGTTTACCTCCATGTATGTCTGTGTGAGGGTATCAGATGCCCT
GGAACTGGAGTTACAAACAGTTGGGAGCTGCCATCTGCGTGCTGGTAATTGAACTTGGATCCTCTGGAAG
AGCAGCCAGTGCTCTTGACTGCTGAACCATCTCTCCAGCCCCAGTCATTTAATTGTTTGTTTGAAGACAG
GGTCTCACGTAGCCAGGCTGGCCTTGGACTCACACTGCAGAGCTGAGGATGGCTTTGAACTGATGAACTT
CCTGGTGCTGGGATTATAGGCTGATACCCCATACCTGGCTTACCTGGTCTTGGGGATTGAAGCAAGGACT
TAGTGATTTCAAGGCAAGGACTCTGCCACTGAGCTGTAGACCCAGCCTCTGACCTAGATCCGACCCTTAA
AAACACCTGCAACCCCAGGACTCAAGAGTGGAAAGAACAAGGATCTTAGAAGTTCACAGTCGTCCTTGGA
TACCTTATTTGGGACAGATAGCCTTGCCTGGACCACGTGGGACATTGGGGAGAGAGAGAGAGAGAGAAAG
AGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAAATCTTGCTTGGCATCAAC
AGAGGAGCTTCAGTTTCACATTACAGAGTATCATGGTCTACAATGCGTGGCATCCCAAGAGGCAGCAAGT
GATAGGATTTAGGCAAGTGTACATGTTGCTCACCTCAATACCTGCCTAATGTCCTGTTTCCTCTGAAGAC
CGAATAACAGCTCATGATTGGTCTAATAGATTCTCAGAAGCAAGAGGAAGGACTGCTGGGCCCGCAGGAC
TCTGGAGACAAGAGTCAGAAACAGCCCTGGAGTTTGGATTGAACTTTTAAATTTGTAGTTTATTTT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AAGCAGGCTCTGCCCCTGGGGTTTCATACTATAGACTG
ATTGCCCTGGAACTTGCTTTGTAGACCAGGCTGGCCTCGAACTCAAAGAGACCCAACTACCTATGCCTTC
CAAGTGCTGGGACTAAAGGTTTGTGCCACTATTGCTGGACTCAGAGGTCAATATTTACAAAATAATTTGT
TTTTATTTTATGTGCATGGATGTTTTGCTTGCAAGTAGTACCTGGTGTGGTGACCAGAAGAGGGTGCCAG
ATGCCATGTGTAGGTGCTAGGTCCACTGTAAGACCTGTTTGTGCTCTTGACCACTGAGCCATCAGCCTAG
CCCTTAGAGGTCACCTTTTGGAAATCTATTTTCTCTTCCACCATATGGATCACCCAGACTAAACTAGGTC
ATCAGACTTGGGTGGCAAACACCTTTACCTTCTGAATAACTTCTTAGTCCACTTTTCCGTGAGATTGTGT
CTGACATAGTGCAGGCTAGCCTCCCATGGGTAGCTGAGGACAACCTTAACATTTGGTGTTTTTTTTTAAA
GATTTATTTATTTATTATACGTAAGTACACTGTAGCTAACTTCAGACACCCCAGAATCAAATCTCATTAC
AGATGGTTGTCAGCCACCATGTGGTTGCTGGGATTTGAATTCAGGACCTATGGAAGAGCAGTCAGTGCTC
TTAACCACTGAGCCATCTCTCCAGCCCCTGTTTTTTTTGTTTTTGGTGTTGTTTTTGTTTTGGTTTTTTG
GGTTTTGGATTTTTAAAAAATATTTATTTACTCATTTATTATATGTAAGTACACTGTAGCTGTCTTCAGA
CACTCCAGAAGATGGCATCAGATTTCATTGTGAATGGTTGTGAGCCACCATGTGGTTGCTGGGATTTGAA
CTCAGGACCTTTGGAAGAGCAGTCGGCGCTCTTAACCACTGAGCCATCTCACCAGCCCCCTGGTTTTGGA
TTTTTTTCAAGGCAGGGTTACTCTGTGTAGCCCTGGCTGTCCTGGAACTCCCTCTGTAAACCGGGCTGGC
CTTGAACTCAGAAATCTGCCTGCCTCTGCCTCCCAAGTGCTGGGATTAAAGGCATGCACCACCATGTCCG
GCCTGGTTTGTTTGTTTTTAAGATAGGATTCTCACTATGTATCCCTAGCTGAGCTAGAACTCTGTAGACC
AGGCTAGCCTCCAACTCACAGAATCCCTCCTGCTTCTGCCTCCGAAGTATTGAGATTAAGGGAATGGGGG
GTGCACCACTATACACTGTATTTATAGAATTGTAATATATGACTTATTTTTAAATACTGACTCTCTACAT
AGCTTGATGTGGGGACCAGGTTGGCCTTGAACTCACAGAGATATGCCTTCTGACTGTTGGGATTAAAGAC
ATATATTACCTAATTTACAGCATCTTTACCTAATAGAAGACTCTGTGCTGGACAAGGTGCTATAGGCCCG
TGATCCCTACTCCCGGGTAGGCTAAGGCAGGGTAGACACAGGTTTGAGGCCAAGCTAACTACAGTATGTG
AGAGCCTACCTCAAAAAAAAAAAAAAAAAGGAAAGGAAAAATATAGGAAAGGAAGAAAGAAAAGTAAGGC
TGAGAAGAGAGGTCAAAGCTTAGTGATGGCCCTGGGGTTCCACTACTGTACCACACCCTCGGTCCTTCAC
TGGGGGATTCTATGAGGGGTTTTACCACGGAGGTACAACCTTAATTCTTTTTAATTTGGGAACAGGGTCT
CCAGTAACTACTATCTCACAAAATCAAGAATTGGTCCTGGACCTGCACACCCCACTCTTTGTTACCGTGA
AGATTTCATGGATTAGTCTTGGAGTTTTGACACAAGTGCAGCTTAGTTTTGCATACCTCAATTCACTTAG
TCTCGGCTAGCCTCAGCCTTGCCAGTCTCCTTCTTTGGCTGGAATTACAGACTGTACCACCACTCTCAGC
TTTTATTGTTTTGTCTTCTTTATTATTTATTTATTTGTTTGTTTGGTTGGTTGGTTTGGTTTTTCGAGAC
AGGGTTTCTCTGTATATCCCTGGCTGTCCAGGAACTCACTTTGTAGACCAGGCTGGCCTTGAACTCAGAA
GTCCGCCTGCCTCTGCCTCCCGAGTGCTGGGATTAAAGGCGTGAGCCACCACACCCGGCTCCTTTGTTGT
TTTTATTGTGTGTGTCTGGCGTGCGAGTGCACACCTGCGTGCCGGGTGAGCATATGGAGGCTGGACAGCT
CTGTGGAGCTATTCTCTTTGTCCAAGTTTACATGAGGGATTGTCTGTTT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CCACAGTGGGTCGAAGGTGGTTCTTCTGAGCGGCGTCGAGCCTAGGCCACCCACCC
CGCAGGTCCAATTCACACTGAATGCCAGCTCGGAGGATCACAAACGAAGCTTCTTTTGCTCTGCCGCTCT
GGAGGTGGCGGGAAAGTTCCTGTTTAAAAACCAGACCCTGGAACTGCACGTGCTGTGTGAGTTGGCTGCA
GTGCTGAGTGATAGTCATTTCCTACTGCCCCATGTGCCTTCGGAGCTTTCCCTGATCTCTGTCTCTGACA
CTATTTCTCCAGATGGTCCTCGGCTGGACGAGACGGACTGCTTGGGGAACTGGACCTGGCAAGAGGGGTC
TCAGCAGACTCTGAAATGCCAGGCCTGGGGGAACCCATCTCCTAAGATGACCTGCAGACGGAAGGCAGAT
GGTGCCCTGCTGCCCATCGGGGTGGTGAAGTCTGTCAAACAGGAGATGAATGGTACATACGTGTGCCATG
CCTTTAGCTCCCATGGGAATGTCACCAGGAATGTGTACCTGACAGTACTGTGTGAGTATCCCAGGATATA
AGGCTGGATGAGGGGTGGGCTAGGTGCCAGGGCCTCAAGTCTCACCATTCCCTTCTGTCTCTACCACACA
GACCACTCTCAAAATAACTGGACTATAATCATTCTGGTGCCAGTACTGCTGGTCATTGTGGGCCTCGTGA
TGGCAGCCTCTTATGTTTATAACCGCCAGAGAAAGATCAGGATATACAAGTTACAGAAGGCTCAGGAGGA
GGCCATAAAACTCAAGGGACAAGCCCCACCTCCCTGAGCCTGCTGGATGAGACTCCTGCCTGGACCCCCT
GCAGGGCAACAGCTGCTGCTGCTTTTGAACAGAATGGTAGACAGCATTTACCCTCAGCCACTTCCTCTGG
CTGTCACAGAACAGGATGGTGGCCTGGGGGATGCACACTTGTAGCCTCAGAGCTAAGAGGACTCGGTGGA
TGGAGCAAGACTGTGAACACGTGTGACCCGGACCCACCTACAGCCCGGTGGACCTTCAGCCAAGAAACGC
TGACTTCATTCTCTATTGCCCCTGCTGAGGGGCTCCTGCCTAAGGAAGACATGATATCCAGTAGACACAA
GCAAGAAGACCACACTTCCCCCCGACACAGGAAAGCTGAGACATTGTCCCCAACTCTTCTTGATGTATTT
ATTAATTTAGAGTTTTACCAGCTATTTATTGAGTACCCTGTATATAGTAGATCAGTGAGGAGGTGAATGT
ATAAGTTATGGCCTGGACCCTGCTGCAGATGCTGTGAGAGTCTGGGGAAAGATCACATGGGTCGAGGGTT
TCTCTACTGGTCAGGATGCTTTTCTCATAAGGGTCGACTTTTTTCACCAGTCACATAAACACTATGTGGA
CTGGCAGTGGTTCTCTGCTCCTCCACATCCTGGAGCGTCCCAGCACCTCCCCACCTACTTTTGTTCCCAA
TGTCAGCCACCATGCCTTAGCAGCTGAACAATCGAGCCTCATGCTCATGAAATCATGGTCCCAGGCGGCT
CCACCTCAAAGAGAAAGCCTGGAAGGAAATGTTCCAACTCCTTAGAAGGGTCGTGCAAGCTGCTGTGGGA
GGGTAAGCACCCCTCCCAGCACAGAAACCTTTCCTTTGAATCAATAAAGTTTTATGTCGGCCTGA";

FullGeneMmusculus=StringReplace[FullGeneMmusculus,"\n"->""];

Manipulate[SmithWatermanSimilarity[StringTake[FullGeneHsapiens,n],StringTake[FullGeneMmusculus,n]],{n,1,15000,1}]

Fruit fly genome

The fruit fly (Drosophila melanogaster) provides a widely used model genome

gPIWI=WolframAlpha["Fruit fly PIWI gene",{{"ReferenceSequence:GeneData",1},"ComputableData"}]

Gene comparison across organisms

fgICAM1 = gICAM1[[1]]

fgPIWI=gPIWI[[1]]

Manipulate[SmithWatermanSimilarity[StringTake[fgICAM1,n],StringTake[fgPIWI,n]],{n,1,50,1}]

ICAM-1 gene in H. sapiens and M. musculus

The ICAM - 1 (Intercellular Adhesion Molecule 1) gene encodes a cell surface glycoprotein expressed on endothelial (lining of blood or lymph vessels) and epithelial (lining of airway) cells. The common cold causing rhinovirus attaches to this glycoprotein in the course of penetrating a host cell. The ICAM - 1 gene in the common mouse (Mus musculus) and humans (Homo sapiens) have been defined above, and are reproduced here. Evaluate the following subsection to load the genome data without need to evaluate the full notebook. Full development of the introductory studies pursued in the following problem set leads to current research, e.g., https : // www.ncbi.nlm.nih.gov/pmc/articles/PMC4015451 /.

ICAM-1 genome data

HsapiensICAM1=GenomeData["ICAM1"];

MmusculusICAM1 ="GTGAGCCAGAGACTATAAAAGCGCCGCCCGCCTCAGTCTGCACCCAGTGCTAGTGCTGAGCTCCGCTGCTACCTGCACTTTGCCCTGGCCCTGCAATGGCTTCAACCCGTGCCAAGCCCACGCTACCTCTGCTCCTGGCC
CTGGTCACCGTTGTGATCCCTGGTGAGTCCGAGGTGGGGTCGCTTTGGGGGGCAGGTCTCCAAACTCCAG
GACCCAGAGCGCGGTCGAAATCCCTGCTTCCCGGCCAGCGGAACATCACATAAATTCAGCTGTTAACGGG
AAGTGGGATTGGAAACCCAGGGTTGAAAACTAACAGCCCGGAGTTCGAATCCCACGTAGCATCACTCCAT
GGGTGGGTTACAGAACCCAAAATCTCGGTCTCTCTCTCTCTCTCTCTCTCTCTCTCTCTCTCCCTCCCAG
TCCCTCCCTCCCTCCCCCTCTCTCTGTCCTCTCTCTCTCCCCCTGTCCCCCTCTTCCCCTCCCTTCCTTT
CTTTCCTGTTTTGAGAATGATGCCTTGACACGTTAGCCTAGGCTGGCCTTGAACTCAGTCCTCAAGGCCT
CGCGGCTCTTCGGGTTACAGGCTCAAAACACACTACTCTCCTAAAACATGCACGTTTAGAACCTGGGCTC
ATGGTCTGTGCAATGGGAACTGTGGTCACAGTCCTTGTCATGGGGCAGTCAGAATATGGCTGAGGTGGGG
AACAGATGGTCTGAGGGGCTGGCCCGTCCTAAAGTGAATCTTGAGGTCCGGTTCCCTCCCCCACAGACAC
CCGTTCCTCATCCTCACCCCTGGGGAAGTCCAGGCTGCTTCTGCGCTGGGGAATTCCAGGGTTGGTGTAC
CCTGGAGCCAGAGTGAGCCGGCTCAGGACTCCCCACCTTGCTGCTGCCTGGGGGCGGCGCCTGCCGTCCT
CCCAAGAGAGGAAGATTCAGAACTTGTTCAGCAGCTATCAGGAGGCTCCCGACTTGGATTCCCGCA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TTTGAGC
TGAGCGAGATCGGGGAGGACAGCAGTCCGCTGTGCTTTGAGAACTGTGGCACCGTGCAGTCGTCCGCTTC
CGCTACCATCACCGTGTATTGTGAGTGGCAGGGCCAGGGCCTGGGAGCAGGGAGACTCACTGGGCACATG
ACAGCCTTGAAAAGTCCCACAGTCACTTAGAGATCTCTTTAAACATCTGCCAGCAGAGTGTGCCATAGGA
ATTTAGAACATTCTAGAATGCCACCATTGGATGCCTGGATTGTTCTGTGTTGTTTTGTTTAATTGTACTC
TATGACTAATTGTGTCTAATGTTTTAGGTTTTTAAAAATAATCAATTTTTAGCCAGGCATGGTGGCGTAC
ACCTTTAATCCCAGCACTCGGGAGGCAGAGGCAGGAGGATTTCTGAGTTCGAGGCCAGCCTGGTCTACAA
AGTGAGTTCCAGGACAGCCAGGGCTACACAGAGAAACCCTGTCTTAAAAAAACCAAAAAAAGAAAAAAAG
TCAATTTTTTATTTTATGTGCATTAGTGGTTTACCTCCATGTATGTCTGTGTGAGGGTATCAGATGCCCT
GGAACTGGAGTTACAAACAGTTGGGAGCTGCCATCTGCGTGCTGGTAATTGAACTTGGATCCTCTGGAAG
AGCAGCCAGTGCTCTTGACTGCTGAACCATCTCTCCAGCCCCAGTCATTTAATTGTTTGTTTGAAGACAG
GGTCTCACGTAGCCAGGCTGGCCTTGGACTCACACTGCAGAGCTGAGGATGGCTTTGAACTGATGAACTT
CCTGGTGCTGGGATTATAGGCTGATACCCCATACCTGGCTTACCTGGTCTTGGGGATTGAAGCAAGGACT
TAGTGATTTCAAGGCAAGGACTCTGCCACTGAGCTGTAGACCCAGCCTCTGACCTAGATCCGACCCTTAA
AAACACCTGCAACCCCAGGACTCAAGAGTGGAAAGAACAAGGATCTTAGAAGTTCACAGTCGTCCTTGGA
TACCTTATTTGGGACAGATAGCCTTGCCTGGACCACGTGGGACATTGGGGAGAGAGAGAGAGAGAGAAAG
AGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAAATCTT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GAGCTTTCTCCTTGGGGAGCCAGGGAGCCTTGGCGGGTGT
GGGAGTGGTCCTAGGATCTGTGTGACAGGAAGCTGGATTACTGGAAGCTGGTGGCAATCGGATCCAGCAA
AAGCCTGCCTGAGCTTGCTGCTTGTGATTGAAGCATCCAAGATGGGAGGGGCAGACAAATATTTGAAGAA
TGGAGAAACTAGGAATTGGTGAGAGACTGAAGTTCGGTGTCAAGAAGTAAGACCATGTACCGTACCATGC
CCTTCCCCGTGTGCCAATGTTTTAATACAGCGAAGCAGGCTCTGCCCCTGGGGTTTCATACTATAGACTG
ATTGCCCTGGAACTTGCTTTGTAGACCAGGCTGGCCTCGAACTCAAAGAGACCCAACTACCTATGCCTTC
CAAGTGCTGGGACTAAAGGTTTGTGCCACTATTGCTGGACTCAGAGGTCAATATTTACAAAATAATTTGT
TTTTATTTTATGTGCATGGATGTTTTGCTTGCAAGTAGTACCTGGTGTGGTGACCAGAAGAGGGTGCCAG
ATGCCATGTGTAGGTGCTAGGTCCACTGTAAGACCTGTTTGTGCTCTTGACCACTGAGCCATCAGCCTAG
CCCTTAGAGGTCACCTTTTGGAAATCTATTTTCTCTTCCACCATATGGATCACCCAGACTAAACTAGGTC
ATCAGACTTGGGTGGCAAACACCTTTACCTTCTGAATAACTTCTTAGTCCACTTTTCCGTGAGATTGTGT
CTGACATAGTGCAGGCTAGCCTCCCATGGGTAGCTGAGGACAACCTTAACATTTGGTGTTTTTTTTTAAA
GATTTATTTATTTATTATACGTAAGTACACTGTAGCTAACTTCAGACACCCCAGAATCAAATCTCATTAC
AGATGGTTGTCAGCCACCATGTGGTTGCTGGGATTTGAATTCAGGACCTATGGAAGAGCAGTCAGTGCTC
TTAACCACTGAGCCATCTCTCCAGCCCCTGTTTTTTTTGTTTTTGGTGTTGTTTTTGTTTTGGTTTTTTG
GGTTTTGGATTTTTAAAAAATATTTATTTACTCATTTATTATATGTAAGTACACTGTAGCTGTCTTCAGA
CACTCCAGAAGATGGCATCAGATTTCATTGTGAATGGTTGTGAGCCACCATGTGGTTGCTGGGATTTGAA
CTCAGGACCTTTGGAAGAGCAGTCGGCGCTCTTAACCACTGAGCCATCTCACCAGCCCCCTGGTTTTGGA
TTTTTTTCAAGGCAGGGTTACTCTGTGTAGCCCTGGCTGTCCTGGAACTCCCTCTGTAAACCGGGCTGGC
CTTGAACTCAGAAATCTGCCTGCCTCTGCCTCCCAAGTGCTGGGATTAAAGGCATGCACCACCATGTCCG
GCCTGGTTTGTTTGTTTTTAAGATAGGATTCTCACTATGTATCCCTAGCTGAGCTAGAACTCTGTAGACC
AGGCTAGCCTCCAACTCACAGAATCCCTCCTGCTTCTGCCTCCGAAGTATTGAGATTAAGGGAATGGGGG
GTGCACCACTATACACTGTATTTATAGAATTGTAATATATGACTTATTTTTAAATACTGACTCTCTACAT
AGCTTGATGTGGGGACCAGGTTGGCCTTGAACTCACAGAGATATGCCTTCTGACTGTTGGGATTAAAGAC
ATATATTACCTAATTTACAGCATCTTTACCTAATAGAAGACTCTGTGCTGGACAAGGTGCTATAGGCCCG
TGATCCCTACTCCCGGGTAGGCTAAGGCAGGGTAGACACAGGTTTGAGGCCAAGCTAACTACAGTATGTG
AGAGCCTACCTCAAAAAAAAAAAAAAAAAGGAAAGGAAAAATATAGGAAAGGAAGAAAGAAAAGTAAGGC
TGAGAAGAGAGGTCAAAGCTTAGTGATGGCCCTGGGGTTCCACTACTGTACCACACCCTCGGTCCTTCAC
TGGGGGATTCTATGAGGGGTTTTACCACGGAGGTACAACCTTAATTCTTTTTAATTTGGGAACAGGGTCT
CCAGTAACTACTATCTCACAAAATCAAGAATTGGTCCTGGACCTGCACACCCCACTCTTTGTTACCGTGA
AGATTTCATGGATTAGTCTTGGAGTTTTGACACAAGTGCAGCTTAGTTTTGCATACCTCAATTCACTTAG
TCTCGGCTAGCCTCAGCCTTGCCAGTCTCCTTCTTTGGCTGGAATTACAGACTGTACCACCACTCTCAGC
TTTTATTGTTTTGTCTTCTTTATTATTTATTTATTTGTTTGTTTGGTTGG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CAACAGCTGCTGCTGCTTTTGAACAGAATGGTAGACAGCATTTACCCTCAGCCACTTCCTCTGG
CTGTCACAGAACAGGATGGTGGCCTGGGGGATGCACACTTGTAGCCTCAGAGCTAAGAGGACTCGGTGGA
TGGAGCAAGACTGTGAACACGTGTGACCCGGACCCACCTACAGCCCGGTGGACCTTCAGCCAAGAAACGC
TGACTTCATTCTCTATTGCCCCTGCTGAGGGGCTCCTGCCTAAGGAAGACATGATATCCAGTAGACACAA
GCAAGAAGACCACACTTCCCCCCGACACAGGAAAGCTGAGACATTGTCCCCAACTCTTCTTGATGTATTT
ATTAATTTAGAGTTTTACCAGCTATTTATTGAGTACCCTGTATATAGTAGATCAGTGAGGAGGTGAATGT
ATAAGTTATGGCCTGGACCCTGCTGCAGATGCTGTGAGAGTCTGGGGAAAGATCACATGGGTCGAGGGTT
TCTCTACTGGTCAGGATGCTTTTCTCATAAGGGTCGACTTTTTTCACCAGTCACATAAACACTATGTGGA
CTGGCAGTGGTTCTCTGCTCCTCCACATCCTGGAGCGTCCCAGCACCTCCCCACCTACTTTTGTTCCCAA
TGTCAGCCACCATGCCTTAGCAGCTGAACAATCGAGCCTCATGCTCATGAAATCATGGTCCCAGGCGGCT
CCACCTCAAAGAGAAAGCCTGGAAGGAAATGTTCCAACTCCTTAGAAGGGTCGTGCAAGCTGCTGTGGGA
GGGTAAGCACCCCTCCCAGCACAGAAACCTTTCCTTTGAATCAATAAAGTTTTATGTCGGCCTGA";

MmusculusICAM1=StringReplace[MmusculusICAM1,"\n"->""];

ICAM-1 gene basic features

The ICAM-1 gene is fairly short, roughly half of the average length of typical human gene.

ICAM1={HsapiensICAM1,MmusculusICAM1};
Map[StringLength[#]&,ICAM1]

Under the default similarity rules, the Mathematica Smith Waterman distance ascribes a +1 to each matched character, and a -1 to each mismatch, insertion or deletion. This gives a roughly 10% similarity in the ICAM1 gene in the two organisms, which would not indicate the two nucelotide sequence encode essentially the same functional protein in H. sapiens and M. Musculus.

SmithWatermanSimilarity[HsapiensICAM1,MmusculusICAM1]

However, the above default similarity rules are mainly adopted for quick evaluation. A more insightful comparison is made when considering the full BLAST approach: carry out all partial alignments, carry out comparison based on amino acid mutation weighting. Consider a small portion of each gene and compare the similarity values

sH=StringTake[HsapiensICAM1,{100,200}];
sM=StringTake[MmusculusICAM1,{100,200}];
SmithWatermanSimilarity[sH,sM]

SmithWatermanSimilarity[sH,sM,SimilarityRules->"BLAST"]

Try a longer subsequence

sH=StringTake[HsapiensICAM1,{101,500}];
sM=StringTake[MmusculusICAM1,{101,500}];
SmithWatermanSimilarity[sH,sM]

SmithWatermanSimilarity[sH,sM,SimilarityRules->"BLAST"]

Try an even longer subsequence

sH=StringTake[HsapiensICAM1,{101,1000}];
sM=StringTake[MmusculusICAM1,{101,1000}];
SmithWatermanSimilarity[sH,sM]

SmithWatermanSimilarity[sH,sM,SimilarityRules->"BLAST"]

SmithWatermanSimilarity[sH,sM,SimilarityRules->"PAM30"]

SmithWatermanSimilarity[sH,sM,SimilarityRules->"PAM70"]

However, carrying out a full comparison using full BLAST requires hours of computer time.  That is the reason intermediate similarity rules are often used, such as weighting mutation according to (P^30) (PAM30) rules.

SmithWatermanSimilarity[HsapiensICAM1,MmusculusICAM1,SimilarityRules->"PAM30"]

Different similarity rules can be defined based on optimally aligned sequences

SequenceAlignment[sH,sM]

Problems

Introduction

In this homework you will carry out a comparison of genes across different organisms. The ICAM-1 (Intercellular Adhesion Molecule 1) gene encodes a cell surface glycoprotein expressed on endothelial (lining of blood or lymph vessels) and epithelial (lining of airway) cells. The common cold causing rhinovirus attaches to this glycoprotein in the course of penetrating a host cell. The ICAM-1 gene in the common mouse (Mus musculus) and humans (Homo sapiens) have been defined above, and are reproduced here. Evaluate the following subsection to load the genome data without need to evaluate the full notebook. Full development of the introductory studies pursued in the following problem set leads to current research, e.g., https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4015451/.

ICAM-1 genome data

HsapiensICAM1=GenomeData["ICAM1"];

MmusculusICAM1 ="GTGAGC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GGCCTGGGAGCAGGGAGACTCACTGGGCACATG
ACAGCCTTGAAAAGTCCCACAGTCACTTAGAGATCTCTTTAAACATCTGCCAGCAGAGTGTGCCATAGGA
ATTTAGAACATTCTAGAATGCCACCATTGGATGCCTGGATTGTTCTGTGTTGTTTTGTTTAATTGTACTC
TATGACTAATTGTGTCTAATGTTTTAGGTTTTTAAAAATAATCAATTTTTAGCCAGGCATGGTGGCGTAC
ACCTTTAATCCCAGCACTCGGGAGGCAGAGGCAGGAGGATTTCTGAGTTCGAGGCCAGCCTGGTCTACAA
AGTGAGTTCCAGGACAGCCAGGGCTACACAGAGAAACCCTGTCTTAAAAAAACCAAAAAAAGAAAAAAAG
TCAATTTTTTATTTTATGTGCATTAGTGGTTTACCTCCATGTATGTCTGTGTGAGGGTATCAGATGCCCT
GGAACTGGAGTTACAAACAGTTGGGAGCTGCCATCTGCGTGCTGGTAATTGAACTTGGATCCTCTGGAAG
AGCAGCCAGTGCTCTTGACTGCTGAACCATCTCTCCAGCCCCAGTCATTTAATTGTTTGTTTGAAGACAG
GGTCTCACGTAGCCAGGCTGGCCTTGGACTCACACTGCAGAGCTGAGGATGGCTTTGAACTGATGAACTT
CCTGGTGCTGGGATTATAGGCTGATACCCCATACCTGGCTTACCTGGTCTTGGGGATTGAAGCAAGGACT
TAGTGATTTCAAGGCAAGGACTCTGCCACTGAGCTGTAGACCCAGCCTCTGACCTAGATCCGACCCTTAA
AAACACCTGCAACCCCAGGACTCAAGAGTGGAAAGAACAAGGATCTTAGAAGTTCACAGTCGTCCTTGGA
TACCTTATTTGGGACAGATAGCCTTGCCTGGACCACGTGGGACATTGGGGAGAGAGAGAGAGAGAGAAAG
AGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAAATCTTGCTTGGCATCAAC
AGAGGAGCTTCAGTTTCACATTACAGAGTATCATGGTCTACAATGCGTGGCATCCCAAGAGGCAGCAAGT
GATAGGATTTAGGCAAGTGTACATGTTGCTCACCTCA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GCCTGCCTGAGCTTGCTGCTTGTGATTGAAGCATCCAAGATGGGAGGGGCAGACAAATATTTGAAGAA
TGGAGAAACTAGGAATTGGTGAGAGACTGAAGTTCGGTGTCAAGAAGTAAGACCATGTACCGTACCATGC
CCTTCCCCGTGTGCCAATGTTTTAATACAGCGAAGCAGGCTCTGCCCCTGGGGTTTCATACTATAGACTG
ATTGCCCTGGAACTTGCTTTGTAGACCAGGCTGGCCTCGAACTCAAAGAGACCCAACTACCTATGCCTTC
CAAGTGCTGGGACTAAAGGTTTGTGCCACTATTGCTGGACTCAGAGGTCAATATTTACAAAATAATTTGT
TTTTATTTTATGTGCATGGATGTTTTGCTTGCAAGTAGTACCTGGTGTGGTGACCAGAAGAGGGTGCCAG
ATGCCATGTGTAGGTGCTAGGTCCACTGTAAGACCTGTTTGTGCTCTTGACCACTGAGCCATCAGCCTAG
CCCTTAGAGGTCACCTTTTGGAAATCTATTTTCTCTTCCACCATATGGATCACCCAGACTAAACTAGGTC
ATCAGACTTGGGTGGCAAACACCTTTACCTTCTGAATAACTTCTTAGTCCACTTTTCCGTGAGATTGTGT
CTGACATAGTGCAGGCTAGCCTCCCATGGGTAGCTGAGGACAACCTTAACATTTGGTGTTTTTTTTTAAA
GATTTATTTATTTATTATACGTAAGTACACTGTAGCTAACTTCAGACACCCCAGAATCAAATCTCATTAC
AGATGGTTGTCAGCCACCATGTGGTTGCTGGGATTTGAATTCAGGACCTATGGAAGAGCAGTCAGTGCTC
TTAACCACTGAGCCATCTCTCCAGCCCCTGTTTTTTTTGTTTTTGGTGTTGTTTTTGTTTTGGTTTTTTG
GGTTTTGGATTTTTAAAAAATATTTATTTACTCATTTATTATATGTAAGTACACTGTAGCTGTCTTCAGA
CACTCCAGAAGATGGCATCAGATTTCATTGTGAATGGTTGTGAGCCACCATGTGGTTGCTGGGATTTGAA
CTCAGGACCTTTGGAAGAGCAGTCGGCGCTCTTAACCACTGAGCCATCTCACCAGCCCCCTGGTTTTGGA
TTTTTTTCAAGGCAGGGTTACTCTGTGTAGCCCTGGCTGTCCTGGAACTCCCTCTGTAAACCGGGCTGGC
CTTGAACTCAGAAATCTGCCTGCCTCTGCCTCCCAAGTGCTGGGATTAAAGGCATGCACCACCATGTCCG
GCCTGGTTTGTTTGTTTTTAAGATAGGATTCTCACTATGTATCCCTAGCTGAGCTAGAACTCTGTAGACC
AGGCTAGCCTCCAACTCACAGAATCCCTCCTGCTTCTGCCTCCGAAGTATTGAGATTAAGGGAATGGGGG
GTGCACCACTATACACTGTATTTATAGAATTGTAATATATGACTTATTTTTAAATACTGACTCTCTACAT
AGCTTGATGTGGGGACCAGGTTGGCCTTGAACTCACAGAGATATGCCTTCTGACTGTTGGGATTAAAGAC
ATATATTACCTAATTTACAGCATCTTTACCTAATAGAAGACTCTGTGCTGGACAAGGTGCTATAGGCCCG
TGATCCCTACTCCCGGGTAGGCTAAGGCAGGGTAGACACAGGTTTGAGGCCAAGCTAACTACAGTATGTG
AGAGCCTACCTCAAAAAAAAAAAAAAAAAGGAAAGGAAAAATATAGGAAAGGAAGAAAGAAAAGTAAGGC
TGAGAAGAGAGGTCAAAGCTTAGTGATGGCCCTGGGGTTCCACTACTGTACCACACCCTCGGTCCTTCAC
TGGGGGATTCTATGAGGGGTTTTACCACGGAGGTACAACCTTAATTCTTTTTAATTTGGGAACAGGGTCT
CCAGTAACTACTATCTCACAAAATCAAGAATTGGTCCTGGACCTGCACACCCCACTCTTTGTTACCGTGA
AGATTTCATGGATTAGTCTTGGAGTTTTGACACAAGTGCAGCTTAGTTTTGCATACCTCAATTCACTTAG
TCTCGGCTAGCCTCAGCCTTGCCAGTCTCCTTCTTTGGCTGGAATTACAGACTGTACCACCACTCTCAGC
TTTTATTGTTTTGTCTTCTTTATTATTTATTTATTTGTTTGTTTGGTTGGTTGGTTTGGTTTTTCGAGAC
AGGGTTTCTCTGTATATCCCTGGCTGTCCAGGAACTCACTTTGTAGACCAGGCTGGCCTTGAACTCAGAA
GTCCGCCTGCCTCTGCCTCCCG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TAAAGG
TCCATCTTGTACTTGAGGCTGAGTGGTCATAGGCGGGGGTTTGCACTGGGCGGGGCTCACGGTGTGTCCC
GCTCCCAGACTTTTCAGCTCCGGTCCTGACCCTGAGCCAGCTGGAGGTCTCGGAAGGGAGCCAAGTAACT
GTGAAGTGTGAAGCCCACAGTGGGTCGAAGGTGGTTCTTCTGAGCGGCGTCGAGCCTAGGCCACCCACCC
CGCAGGTCCAATTCACACTGAATGCCAGCTCGGAGGATCACAAACGAAGCTTCTTTTGCTCTGCCGCTCT
GGAGGTGGCGGGAAAGTTCCTGTTTAAAAACCAGACCCTGGAACTGCACGTGCTGTGTGAGTTGGCTGCA
GTGCTGAGTGATAGTCATTTCCTACTGCCCCATGTGCCTTCGGAGCTTTCCCTGATCTCTGTCTCTGACA
CTATTTCTCCAGATGGTCCTCGGCTGGACGAGACGGACTGCTTGGGGAACTGGACCTGGCAAGAGGGGTC
TCAGCAGACTCTGAAATGCCAGGCCTGGGGGAACCCATCTCCTAAGATGACCTGCAGACGGAAGGCAGAT
GGTGCCCTGCTGCCCATCGGGGTGGTGAAGTCTGTCAAACAGGAGATGAATGGTACATACGTGTGCCATG
CCTTTAGCTCCCATGGGAATGTCACCAGGAATGTGTACCTGACAGTACTGTGTGAGTATCCCAGGATATA
AGGCTGGATGAGGGGTGGGCTAGGTGCCAGGGCCTCAAGTCTCACCATTCCCTTCTGTCTCTACCACACA
GACCACTCTCAAAATAACTGGACTATAATCATTCTGGTGCCAGTACTGCTGGTCATTGTGGGCCTCGTGA
TGGCAGCCTCTTATGTTTATAACCGCCAGAGAAAGATCAGGATATACAAGTTACAGAAGGCTCAGGAGGA
GGCCATAAAACTCAAGGGACAAGCCCCACCTCCCTGAGCCTGCTGGATGAGACTCCTGCCTGGACCCCCT
GCAGGGCAACAGCTGCTGCTGCTTTTGAACAGAATGGTAGACAGCATTTACCCTCAGCCACTTCCTCTGG
CTGTCACAGAACAGGATGGTGGCCTGGGGGATGCACACTTGTAGCCTCAGAGCTAAGAGGACTCGGTGGA
TGGAGCAAGACTGTGAACACGTGTGACCCGGACCCACCTACAGCCCGGTGGACCTTCAGCCAAGAAACGC
TGACTTCATTCTCTATTGCCCCTGCTGAGGGGCTCCTGCCTAAGGAAGACATGATATCCAGTAGACACAA
GCAAGAAGACCACACTTCCCCCCGACACAGGAAAGCTGAGACATTGTCCCCAACTCTTCTTGATGTATTT
ATTAATTTAGAGTTTTACCAGCTATTTATTGAGTACCCTGTATATAGTAGATCAGTGAGGAGGTGAATGT
ATAAGTTATGGCCTGGACCCTGCTGCAGATGCTGTGAGAGTCTGGGGAAAGATCACATGGGTCGAGGGTT
TCTCTACTGGTCAGGATGCTTTTCTCATAAGGGTCGACTTTTTTCACCAGTCACATAAACACTATGTGGA
CTGGCAGTGGTTCTCTGCTCCTCCACATCCTGGAGCGTCCCAGCACCTCCCCACCTACTTTTGTTCCCAA
TGTCAGCCACCATGCCTTAGCAGCTGAACAATCGAGCCTCATGCTCATGAAATCATGGTCCCAGGCGGCT
CCACCTCAAAGAGAAAGCCTGGAAGGAAATGTTCCAACTCCTTAGAAGGGTCGTGCAAGCTGCTGTGGGA
GGGTAAGCACCCCTCCCAGCACAGAAACCTTTCCTTTGAATCAATAAAGTTTTATGTCGGCCTGA";

MmusculusICAM1=StringReplace[MmusculusICAM1,"\n"->""];

Problem 1

Define a similarity measure that ascribes weight (2^n) to n matched characters, -n to n mismatched characters (-1 for a gap). Such a weighting returns higher similarity for finding long common sequences. Apply the similarity rule to substrings of length 1000, 2000, ..., 12000 in the ICAM1 gene in H. sapiens and M. musculus. (two points)

Define the weights

Weight[seq_]:=Module[{},
If[StringQ[seq],n=StringLength[seq]; Return[(2^n)]];
Return[ -Max[Map[StringLength[#]&,seq]]]
]

Check how the weights work

Weight["CTG"]

Weight[{"","CTG"}]

Map[Weight[#]&,SequenceAlignment[sH,sM]]

The similarity measure is now simply the total of applying the weights to the aligned sequence.

SM[seq1_,seq2_]:= Total[Map[Weight[#]&,SequenceAlignment[seq1,seq2]]]

SM[sH,sM]

Apply to subsequences of the mouse, human ICAM1 gene

Table[SM[StringTake[HsapiensICAM1,n],StringTake[MmusculusICAM1,n]],{n,1000,12000,1000}]

Problem 2

Instead of comparing full genes, a common task is to seek what small subsequence is most similar to a gene in another organism. Choose a random integer L between 400 and 600. Find which portion of length L from the M. musculus ICAM1 gene is most similar to the H. sapiens ICAM1 gene using BLAST. (three points)

L=RandomInteger[{400,600}]

sub[a_]:=SmithWatermanSimilarity[
StringTake[MmusculusICAM1,{a,a+L-1}],
HsapiensICAM1,
SimilarityRules->"BLAST"]

Test the above, recording the execution time

{dt,sm}=Timing[sub[1000]]

Choose a reasonable evaluation time, e.g., 10 minutes

nM = StringLength[MmusculusICAM1];
AllowedTime=600.; stride = Floor[nM dt/AllowedTime]

Compute the similarity measures

sms=Monitor[Table[{i,sub[i]},{i,1,nM-L,stride}],i]

Plot the results

ListPlot[sms]

A maximum similarity is obtained at position 10531, for a score of 1005.

Problem 3

Extra credit (4 points).  The small subsequence itself might have insertions. Define subsequences of length L constructed by taking 4 random successive portions of the M. musculus ICAM1 gene. Do you obtain a higher similarity than in Problem 2 under BLAST similarity rules?