Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flair align - no mapping #2

Closed
steffi778 opened this issue Dec 18, 2018 · 3 comments
Closed

flair align - no mapping #2

steffi778 opened this issue Dec 18, 2018 · 3 comments

Comments

@steffi778
Copy link

Hello,

I just found your tool and I am really excited to try it out for my PacBio data.
However, I tried at first flair align and it did not work at all. It seems it skips the mapping because my generated bam file is empty...

Of course I can map my data independently but maybe you can check the wrapper function?

Here my command & output:

python ~/programs/flair/flair.py align -r filtered.A_Nipponbare.fasta -g Oryza_sativa.IRGSP-1.0.dna.toplevel.fa -sam samtools1.9 -o test_Nipponbare -m ~/programs/minimap2/minimap2

Aligning to the genome with minimap2
Converting output sam
[E::hts_open_format] Failed to open file test_Nipponbare.sam
samtools view: failed to open "test_Nipponbare.sam" for reading: No such file or directory
[bam_sort] Use -T PREFIX / -o FILE to specify temporary and final output files
Usage: samtools sort [options...] [in.bam]
Options:
-l INT Set compression level, from 0 (uncompressed) to 9 (best)
-m INT Set maximum memory per thread; suffix K/M/G recognized [768M]
-n Sort by read name
-t TAG Sort by value of TAG. Uses position as secondary index (or read name if -n is set)
-o FILE Write final output to FILE rather than standard output
-T PREFIX Write temporary files to PREFIX.nnnn.bam
--input-fmt-option OPT[=VAL]
Specify a single input file format option in the form
of OPTION or OPTION=VALUE
-O, --output-fmt FORMAT[,OPT[=VAL]]...
Specify output format (SAM, BAM, CRAM)
--output-fmt-option OPT[=VAL]
Specify a single output file format option in the form
of OPTION or OPTION=VALUE
--reference FILE
Reference sequence FASTA FILE [null]
-@, --threads INT
Number of additional threads to use [0]
[E::hts_open_format] Failed to open file test_Nipponbare.bam
samtools index: failed to open "test_Nipponbare.bam": No such file or directory

@belgravia
Copy link
Collaborator

Hello! So I forgot to uncomment some important lines for minimap2 alignment. I have fixed this now and the wrapper should work. Let me know if there are more issues.
-Alison

@steffi778
Copy link
Author

steffi778 commented Dec 19, 2018

Cool, thanks.
Just tried it out and the mapping is working now.

Problem now to sort the bam file. I gave my file an output name with the -o flag and I got a "name.unsorted.bam". Samtools tells me now "name.bam": No such file or directory.

Maybe you can add the "unsorted" to the name used for samtools sort/index in your script and then it should work?

Cheers,
Stephie

@belgravia
Copy link
Collaborator

So the last file you have that FLAIR made was name.unsorted.bam?
What the wrapper is supposed to do after that is take name.unsorted.bam and run it through samtools sort directing output to a file called name.bam. I ran a test file through the wrapper and it behaved as expected.

I am using samtools v0.1.19-44428cd. I tried running the same commands in FLAIR using samtools v1.9 (this is your version, correct?) and this seems to be the problem. Looks like samtools sort syntax in my wrapper needs to be altered to accommodate the new version.

Anyway long story short, the wrapper should work for you now if you specify an additional argument, -v1.9. I think a more robust fix could be made, but this should work for now.

Thanks for pointing this out :D
Let me know if there are more issues.
-Alison

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants