Open malj390 opened 5 years ago
I was also running into this problem.
The sequence seems to get reversed correctly with a 6-column BEDfile (in your example there is no 'score' column).
Still, even with 6-column files, when -name and -s are used, getfasta appends (-) or (+) to the name which is not the expected behaviour (there should be no change to the name?), that is shown in the docs.
I had this problem and it ended up being a problem with my bed file.
First, I'd recommend you insert a "score" column and just have a 1 on all rows. Next, make sure that the "end of line" character is formatted for unix (it should just be \n not \r\n). If you have the windows EOL character bedtools will not read the strand correctly.
Hello everyone,
I have a test.bed file with this structure:
I would like to get the fasta file so for that I am using bedtools getfasta like this:
bedtools getfasta -name -s -fullHeader -fi hg38.fa -bed test.bed -fo test.fasta
-s should give the proper strand but it doesn't
bedtools doesn't allow the "start and end" to be on the opposite way "end and start" so I reverse the position but I conserve the sign for the strand to get the reverse complement sequences in those genes that are in the negative strand.
Anyone knows what I am doing wrong or how to achieve the reverse complement obeying the strand?
I know how to make the reverse complement in Python and I can solve it, but I just don't want to add more unnecessary steps to the code, I would like to use the function that bedtools already has to solve this.
Thank you, Miguel