This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Find a kinase (here ABL1) consensus sequence in protein sequences using R. | |
proteins <- c("P00519", "P46109", "P61769") # ABL1, CRKL, B2M | |
for (ii in proteins) { | |
prot_url <- paste("http://www.uniprot.org/uniprot/", ii, ".fasta", sep="") # url of protein fasta | |
protein_fasta <- scan(file=url(prot_url), what="character", sep="\t") # read the protein fasta | |
protein_seq <- paste(protein_fasta[2:length(protein_fasta)], collapse="") # amino acid sequence only | |
# print(protein_seq) | |
for (ik in which(strsplit(protein_seq, '')[[1]]=='Y')) { | |
tyr_context <- substr(protein_seq, ik-1, ik+3) | |
# print(tyr_context) |