[Bioc-sig-seq] passing sequences on the fly to cosmo()

Harris A. Jaffee hj at jhu.edu
Fri Jan 21 17:30:24 CET 2011


The source shows that cosmo() uses this function to handle the 'seqs'  
argument.
I haven't tried it.

 > cosmo:::getSequences
function (seqs)
{
     if (is.character(seqs)) {
         if (seqs == "browse") {
             seqs <- fileBrowser(textToShow = "Sequence File (in  
FASTA format)")
         }
         if (!file.exists(seqs))
             stop(paste("Sequence file", seqs, "not found."))
         seqs <- readFASTA(seqs)
     }
     if (class(seqs) != "list")
         stop("seqs must be browse, the path to a sequence file, or a  
list of sequences")
     seqList <- list()
     descList <- list()
     for (i in 1:length(seqs)) {
         seqList[[i]] <- seqs[[i]]$seq
         descList[[i]] <- seqs[[i]]$desc
     }
     seqMat <- seqList2seqMat(seqList)
     list(seqMat = seqMat, seqList = seqList, descList = descList)
}
<environment: namespace:cosmo>

On Jan 21, 2011, at 10:19 AM, Ivan Gregoretti wrote:

> Hello everybody,
>
> The package cosmo is used for detection of motifs.
>
> In it's simplest form, you can run it successfully with only three  
> commands:
>
> library(cosmo)
> seqFile <- system.file("Exfiles/seq.fasta", package = "cosmo")
> results <- cosmo(seqs = seqFile, minW = 7, maxW = 8, models = c 
> ("OOPS", "TCM"))
>
>
> Note:
> In this case, seqs takes a connection to a fasta file.
>
>
> My question:
> Can anybody give me a hand to figure out how to pass sequences to seqs
> without using a file?
>
>
> The documentation (?cosmo) says:
> seqs: This argument specifies the sequences to be analyzed.  If seqs
> == "browse", a browser appears that allows the user to select a file
> that contains the sequences in FASTA format. If seqs is another
> character string, it is assumed to give the path to a FASTA file
> containing the sequences of interest.  Lastly, seqs may be a list with
> each element representing a sequence in the form of a single string
> such as "ACGTAGCTAG" ("seq" entry) and a description ("desc" entry).
>
>
> The package's author:
> I contacted him but he does not work in this anymore. Dead end.
>
>
> Thank you,
>
> Ivan
>
> Ivan Gregoretti, PhD
> National Institute of Diabetes and Digestive and Kidney Diseases
> National Institutes of Health
> 5 Memorial Dr, Building 5, Room 205.
> Bethesda, MD 20892. USA.
> Phone: 1-301-496-1016 and 1-301-496-1592
> Fax: 1-301-496-9878
>
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing



More information about the Bioc-sig-sequencing mailing list