[Seqinr-forum] HELP for using R for codon usage data analysis

THIOULOUSE JEAN Jean.Thioulouse at univ-lyon1.fr
Tue Mar 13 13:39:26 CET 2012


Hi,

The error message is very clear:

cannot open file 'mygenome1.fasta': No such file or directory

This means that you probably misspelled the file name or that you didn't put the file in the right place.

Jean



Le 13 mars 2012 à 10:14, Kinshuk Nayak a écrit :

> Sir,
> I am a student in bioinformaics.I am interested to use R 2.14.1 for codon usage analysis like example given at http://pbil.univ-lyon1.fr/datasets/charif04/. Here the example is customised for three genomes.I would like to run it for my sequence data/ genome. I have filtered set of sequences having length >300bp and stored in fasta format(mygenome1.fasta)  in the folder in which R2.14.1 is installed. I have edited R script as follows.But it is showing error message during running the script.Could you please check and correct it.
>  
> SCRIPT
>  
> library(ade4)
> library(seqinr)
> 
> sessionInfo()
>  
> mygenome1 <-read.fasta("mygenome1.fasta",seqonly=T)                 
> seqmygenome1 <- lapply(mygenome1$req, getSequence)
> ####################################################################
> #
> # From sequences, build dataframes with codon usage for each sequence. 
> #
> ####################################################################
> mkdata <- function(seqs)
> {
>   tab <- sapply(seqs, uco)  
>   tab <- as.data.frame(tab)
>   return( tab )
> }
> tabmygenome1 <- mkdata(seqmygenome1)
> ####################################################################
> #
> # Run correspondence analysis on merged dataset:
> #
> ####################################################################
> tab <- cbind(tabmygenome1)
> names(tab) <- 1:ncol(tab)
> coa <- dudi.coa(tab, scan = FALSE, nf = 2)
> ####################################################################
> #
> # Run synonymous codon usage analysis:
> #
> ####################################################################
> facaa <- as.factor(aaa(translate(sapply(rownames(tab),s2c))))
> scua <- wca(coa, facaa, scan = FALSE, nf = 2)
> ####################################################################
> #
> # Plot first factorial map:
> #
> ####################################################################
> facsp <- as.factor(rep(c("mygenome1"),
>                        c(ncol(tabmygenome1)))
> s.class(scua$co, fac = facsp, cstar = 0, label = "",
>         col = c("green"), cell=0, cpoint=0.8,
>         sub="First factorial map for synonymous codon usage in Tri-Tryp")
> s.label(scua$li, add.plot = TRUE, clab = 0.75)
> legend( x = 0.1, y = -0.4, pch = 19, col = c("green"), 
>        legend = c(expression(italic("mygenome1")),
>                   
>        xjust = 0, cex = 0.8)
> ####################################################################
> #
> # END
> #
> ####################################################################
>  
> AFTER RUNNING
>  
>  > library(ade4)
> Attaching package: ‘ade4’
> The following object(s) are masked from ‘package:base’:
>     within
> > library(seqinr)
> > sessionInfo()
> R version 2.14.1 (2011-12-22)
> Platform: i386-pc-mingw32/i386 (32-bit)
> locale:
> [1] LC_COLLATE=English_United States.1252 
> [2] LC_CTYPE=English_United States.1252   
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C                          
> [5] LC_TIME=English_United States.1252   
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base    
> other attached packages:
> [1] seqinr_3.0-6 ade4_1.4-17 
> > mygenome1 <-read.fasta("mygenome1.fasta",seqonly=T) 
> Error in file(con, "r") : cannot open the connection
> In addition: Warning message:
> In file(con, "r") :
>   cannot open file 'mygenome1.fasta': No such file or directory
>  
>  
> Thanking you
> Kinshuk Chandra Nayak
> Lab. Tech & In-Charge IPR Cell
> Institute of Life Sciences
> Department of Biotechnology,Govt India
> Bhubaneswar-751023,
> India
> Ph-0674-2300137,2301460,2301476,2301219 (EXTN:279)
> Mail:
> kinshuk at ils.res.in
> kinshukils at hotmail.com
> kinshuk_nayak at yahoo.co.in
> _______________________________________________
> Seqinr-forum mailing list
> Seqinr-forum at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/seqinr-forum

--
Jean Thioulouse - Labo Biometrie et Biologie Evolutive,  UMR CNRS 5558
Universite Lyon 1, Batiment Mendel,   43 Boulevard du 11 Novembre 1918
                  69622 Villeurbanne Cedex - France                   
Tel : (33)(0)472432756  Fax : (33)(0)472431388  Cel : (33)(0)675122302    
http://pbil.univ-lyon1.fr/JTHome/       http://twitter.com/#!/jt200469



More information about the Seqinr-forum mailing list