[Bioc-sig-seq] fastq2fasta

Martin Morgan mtmorgan at fhcrc.org
Tue Aug 4 04:37:41 CEST 2009


joseph wrote:
> I got an error:
>> names(sr) <- id(fq)
> Error in `names<-`(`*tmp*`, value = <S4 object of class "BStringSet">) :
>   'value' must be NULL or a character vector

What is your sessionInfo()? Mine is

> sessionInfo()
R version 2.9.1 Patched (2009-07-31 r49053)
x86_64-unknown-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] ShortRead_1.3.11   lattice_0.17-25    BSgenome_1.13.6
Biostrings_2.13.15
[5] IRanges_1.3.25

loaded via a namespace (and not attached):
[1] Biobase_2.4.1 grid_2.9.1    hwriter_1.1

as an alternative

names(sr) <- as.character(id(fq))

Martin



> 
> 
> ------------------------------------------------------------------------
> *From:* Martin Morgan <mtmorgan at fhcrc.org>
> *To:* joseph <jdsandjd at yahoo.com>
> *Cc:* bioc-sig-sequencing at r-project.org
> *Sent:* Monday, August 3, 2009 7:06:56 PM
> *Subject:* Re: [Bioc-sig-seq] fastq2fasta
> 
> Hi Joseph --
> 
> One way, for some file 'fin' to file 'fout'
> 
> fq <- readFastq(fin)
> sr <- sread(fq)
> names(sr) <- id(fq)
> write.XStringSet(sr, fout, format="fasta")
> 
> Martin
> 
> joseph wrote:
>> Hello
>> Can you show me how to use ShortRead to convert a fastq file  like
> this one
>> @7:1:1
>> NNNNNNN
>> +
>> %%%%%%
>> @7:1:2
>> NNNNNNN
>> +
>> %%%%%%
>>
>> to a fasta file keeping only the id and the read: 
>>
>>> @7:1:1
>> NNNNNNNN
>>> @7:1:2
>> NNNNNNNN
>>
>> Thanks in advance
>> Joseph
>>
>>
>>     
>>     [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioc-sig-sequencing mailing list
>> Bioc-sig-sequencing at r-project.org
> <mailto: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