sequence - A for loop with strsplit in R error -


i'd preface post new r , bioinformatics coding, , i'd appreciate input knowledgable community. goal code posted below generate pie charts show amino acid abundance per protein blast results. uploaded csv file uniprot, converted matrix, , wrote out code below. keep getting error: in aas[i] = table(strsplit(blast_aa_seqs[i], "", usebytes = true)) :number of items replace not multiple of replacement length. column 8 output column contains amino acid sequences. in advance!

mydata=read.table("cdpkbeta_blast_results.csv",header=true,sep=",") mydata=as.matrix(mydata)  aas=c() blast_aa_seqs=c() for(i in 1:nrow(mydata)){   print(i)   blast_aa_seqs[i]=mydata[i,8]   aas[i]=table(strsplit(blast_aa_seqs[i],"", usebytes=true))   pie(aas, col=rainbow(length(aas)), main="residue abundance")   } 

lal<-c() lal[1]=table(strsplit("", "", usebytes = t)) 

empty string problem (blast_aa_seqs[i] empty string)


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -