Question: Seqinr Cannot Recognize ">" Character In File
3
gravatar for Partha
8.3 years ago by
Partha30
Partha30 wrote:

i have a fasta file of nucleic acid sequences with sequences beginning like

>YHR055C cdna:known chromosome:EF4:VIII:214533:214718:-1 gene:YHR055C gene_biotype:protein_coding transcript_biotype:protein_coding
ATGTTCAGCGAATTAATTAACTTCCAAAATGAAGGTCATGAGTGCCAATGCCAATGTGGT
AGCTGCAAAAATAATGAACAATGCCAAAAATCATGTAGCTGCCCAACGGGGTGTAACAGC
GACGACAAATGCCCCTGCGGTAACAAGTCTGAAGAAACCAAGAAGTCATGCTGCTCTGGG
AAATGA

but the command in R

read.fasta(file = system.file("x.fa", package = "seqinr"), 
+            seqtype = "DNA",  as.string = FALSE, forceDNAtolower = TRUE,
+            set.attributes = TRUE, legacy.mode = TRUE, seqonly = FALSE, strip.desc =   FALSE)
Error in read.fasta(file = system.file("x.fa", package = "seqinr"),  : 
  no line starting with a > character found
In addition: Warning message:
In file(con, "r") :
  file("") only supports open = "w+" and open = "w+b": using the former

i have tried with many other files in my pc where DNA or amino acid sequences are there. but it cannot find the ">" character.

please help

fasta • 4.7k views
ADD COMMENTlink modified 8.3 years ago by Michael Dondrup47k • written 8.3 years ago by Partha30

Edited to make question readable. Please format code and sequences by indenting lines with 4 spaces in future.

ADD REPLYlink written 8.3 years ago by Neilfws48k

Also, as seen in the answers below, question title is misleading. Problem is nothing to do with seqinr not recognising ">" - it's that it can't find the file.

ADD REPLYlink written 8.3 years ago by Neilfws48k
8
gravatar for Neilfws
8.3 years ago by
Neilfws48k
Sydney, Australia
Neilfws48k wrote:

Part of your problem is that you have copy-pasted the read.fasta() command from somewhere, without understanding what it does.

The part which reads:

file = system.file("x.fa", package = "seqinr")

is looking for a file named ""x.fa" distributed with the seqinr package. There is no such file, so the command fails - admittedly, with a rather confusing error message.

If you have saved your own fasta file and called it "x.fa", then all you need is:

read.fasta("x.fa")

Assuming that the file is in the directory from which you are running R.

I think you need to take some time to learn the basics of R and in particular, how to interpret the contents of command help pages.

ADD COMMENTlink written 8.3 years ago by Neilfws48k
0
gravatar for Michael Dondrup
8.3 years ago by
Bergen, Norway
Michael Dondrup47k wrote:

Your command call is wrong, possibly, dont use 'system.file'. Simply set your file like 'file = x.fa' and try again.

ADD COMMENTlink written 8.3 years ago by Michael Dondrup47k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1068 users visited in the last hour