How determine to read specific size from file using R language
1
0
Entering edit mode
6.8 years ago

need help? , my problem is that i have fastq file with size 50 Gigabyte i cannot read it using R because my ram is 8 giga, so i want to read specific size from it and make it as stream to read x size until i finish operation on all the 50 giga !

R fastq RNA-Seq python • 1.5k views
ADD COMMENT
0
Entering edit mode

You could split the original file into smaller chunks.

ADD REPLY
0
Entering edit mode

how i do that using R !? is there function to do that ?

ADD REPLY
0
Entering edit mode

You could use reformat.sh from BBMap suite to break the files into smaller chunks. reformat.sh will work on Windows/Unix as long as you have Java installed. Look at the "sampling" options in in-line help for reformat.sh.

ADD REPLY
0
Entering edit mode

Not sure why your question is about R and you also tag Python but in Python you could just iterate over the file without loading it into memory first. I don't know about R though.

ADD REPLY
0
Entering edit mode

i also tagged python to know how to do that in case of i did not found that by R, so is there link to do that by python?

ADD REPLY
0
Entering edit mode

I assume you have no Python experience? If you have, the Biopython tutorial and cookbook would be worth going through.

ADD REPLY
0
Entering edit mode
6.8 years ago
jomo018 ▴ 730

You can use read.table() with nrows and skip tags.

ADD COMMENT
0
Entering edit mode

the file is Fastq extention so it does not have specific schema like TSV or CSV it look like as string

ADD REPLY
0
Entering edit mode

jomo018 just gave you the solution. No need to explain how a fastq file looks like.

ADD REPLY

Login before adding your answer.

Traffic: 1629 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6