Using Rsamtools to input BAM files
0
0
Entering edit mode
4.7 years ago

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.

bam rsamtools • 1.8k views
ADD COMMENT
1
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 1675 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