Question: Using Rsamtools to input BAM files
gravatar for Nathalia Scheltinga
7 days ago by
Nathalia Scheltinga0 wrote:

Hello. I've been trying to use Rsamtools to input .bam files but when i use

bam <- scanbam("myfile.bam")

it keeps telling me my file doesn't exist, even though it does. I'm really new with the whole bioinformatics stuff, so maybe that's a really dumb question but I would really appreciate some help.

rsamtools bam • 102 views
ADD COMMENTlink modified 1 day ago by Biostar ♦♦ 20 • written 7 days ago by Nathalia Scheltinga0

By default programs look for files in certain set of directories. With R it is going to be your current/working directory. See more information here.

Either set your working directory to the location where you bam file is or provide full path to read the file from an existing location.

bam <- scanbam("/full_path_to/myfile.bam")
ADD REPLYlink modified 7 days ago • written 7 days ago by genomax70k

I used setwd() to change my directiory to where my files where but it didn't work. Then I tried providing the full path to my file and it still didn't work.

ADD REPLYlink written 6 days ago by Nathalia Scheltinga0

it still didn't work

What did not work? Are you getting an error? What are you trying to do with your files? Perhaps you don't need to use R at all. There are other command line programs that you can use instead.

ADD REPLYlink modified 6 days ago • written 6 days ago by genomax70k

I keep getting the message that my files don't exist. I actually want to run some packages that do CNV analysis but I can't even input my files on R.

ADD REPLYlink written 6 days ago by Nathalia Scheltinga0

Can you copy & paste the entire error message? Are you using a Windows machine?

ADD REPLYlink written 6 days ago by Friederike4.8k

After the setwd(), run a list.files() and give us the output please. Also, please give us the exact commands you're using.

ADD REPLYlink written 6 days ago by RamRS23k
Please log in to add an answer.


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