hello,
i would like to transform a csv file which include dna sequences to fasta format, using r studio and the library biostring.
The csv file has 4 columns, the name of the chromosome, the start and end of dna sequence and the strand (missing or +).
What code should i use to transform this file.
Thank you very much. Your answer was really helpfull but i have a problem on using the GRanges and IRages seq from Bioconductor. The error that is appeared is: e(s) not installed when version(s) same as current; use force = TRUE to re-install: 'GenomeRanges'.
Do you have any suggestion how to solve it. I tried different things such as dowload devtools and genefilter but nothing changed.
Also, do you know some other sequence which can replace the GRanges and IRanges.
Thank you.
It's better for us if you just copy and paste the R output rather than just a snippet like that. Do note that there isn't a package called GenomeRanges so that might be your problem. You want GenomicRanges instead. The 'error' you post isn't an error, but instead a message telling you that you already have the current version of a package installed, and if you want to re-install you need to add force = TRUE to BiocManager::install in order to make it re-install. Otherwise it will just tell you that you already have the current version.
If you do paste code, either enclose between a set of triple backticks (```) so it is formatted correctly, or alternatively paste the code, highlight the code, and then click on the button above the reply box that says 'code'.
My problem about the GRanges and IRanges was solved. But another problem was appeared. When i run this code: gr <- GRanges(chr, IRanges(start = start,end = end)), it tells that:
Error in .new_IRanges_from_start_end(start, end) :
'start' and 'end' must be numeric vectors
Thank you very much. Your answer was really helpfull but i have a problem on using the GRanges and IRages seq from Bioconductor. The error that is appeared is: e(s) not installed when version(s) same as current; use force = TRUE to re-install: 'GenomeRanges'. Do you have any suggestion how to solve it. I tried different things such as dowload devtools and genefilter but nothing changed. Also, do you know some other sequence which can replace the GRanges and IRanges. Thank you.
It's better for us if you just copy and paste the R output rather than just a snippet like that. Do note that there isn't a package called
GenomeRanges
so that might be your problem. You wantGenomicRanges
instead. The 'error' you post isn't an error, but instead a message telling you that you already have the current version of a package installed, and if you want to re-install you need to addforce = TRUE
toBiocManager::install
in order to make it re-install. Otherwise it will just tell you that you already have the current version.If you do paste code, either enclose between a set of triple backticks (```) so it is formatted correctly, or alternatively paste the code, highlight the code, and then click on the button above the reply box that says 'code'.
My problem about the GRanges and IRanges was solved. But another problem was appeared. When i run this code:
gr <- GRanges(chr, IRanges(start = start,end = end)),
it tells that:what did i do wrong? Thank you.