mrmckain / Fast-Plast

Automated de novo assembly of whole chloroplast genomes.
MIT License
43 stars 14 forks source link

Issue with option only_coverage #27

Closed michaelgruenstaeudl closed 5 years ago

michaelgruenstaeudl commented 5 years ago

Hi Michael, I am having difficulties using the option only_coverage of Fast-Plast. Here are the details:

I am attempting to conduct a coverage analysis on an assembled plastid genome using Fast-Plast. To that end, I use the following code:

perl /home/user/git/Fast-Plast/fast-plast.pl \
    -1 /home/user/sample1/sample1_R1.fastq.gz \
    -2 /home/user/sample1/sample1_R2.fastq.gz \
    --name sample1 \
    --only_coverage /home/user/sample1/sample1_Assembly.fasta \
    --min_coverage 20

Upon read trimming and starting the coverage analysis, the Fast-Plast code throws the following error:

...
TrimmomaticPE: Completed successfully
Building a SMALL index
terminate called after throwing an instance of 'std::runtime_error'
  what():  Can't open file '0/map_*'
sh: 0/sample1_25dump: No such file or directory
readline() on closed filehandle $dfile at /home/user/git/Fast-Plast/Coverage_Analysis/new_window_coverage.pl line 44.
Fast-Plast finished.

In accordance with the above error, the output file sample1.coverage_25kmer.txt indicates a coverage of zero across the entire assembled plastid genome:

$ cat sample1.coverage_25kmer.txt
GATTCACAATCCACTGCGAGGGCGA   0   0
ATTCACAATCCACTGCGAGGGCGAA   1   0
TTCACAATCCACTGCGAGGGCGAAC   2   0
...
AGGGATTCACAATCCACTGCGAGGG   159197  0
GGGATTCACAATCCACTGCGAGGGC   159198  0
GGATTCACAATCCACTGCGAGGGCG   159199  0

However, the read mapping against the assembled plastid genome was successful as evidenced by considerable file sizes of the SAM and the hits files:

$ ls -l
total 6071608
-rwxrwxrwx 1 user users    5015129 Oct 24 17:16 map_hits.fq
-rwxrwxrwx 1 user users   64012989 Oct 24 17:16 map_pair_hits.1.fq
-rwxrwxrwx 1 user users   56886509 Oct 24 17:16 map_pair_hits.2.fq
-rwxrwxrwx 1 user users    4249451 Oct 24 16:52 sample1_bowtie.1.bt2
-rwxrwxrwx 1 user users      39748 Oct 24 16:52 sample1_bowtie.2.bt2
-rwxrwxrwx 1 user users       1484 Oct 24 16:52 sample1_bowtie.3.bt2
-rwxrwxrwx 1 user users      39741 Oct 24 16:52 sample1_bowtie.4.bt2
-rwxrwxrwx 1 user users    4249451 Oct 24 16:52 sample1_bowtie.rev.1.bt2
-rwxrwxrwx 1 user users      39748 Oct 24 16:52 sample1_bowtie.rev.2.bt2
-rwxrwxrwx 1 user users    5460890 Oct 24 17:16 sample1.coverage_25kmer.txt
-rwxrwxrwx 1 user users     142146 Oct 24 17:16 sample1_coverage.pdf
-rwxrwxrwx 1 user users        947 Oct 24 17:16 sample1_problem_regions_plastid_assembly.txt
-rwxrwxrwx 1 user users 6077158286 Oct 24 17:16 sample1.sam

I have received the above issue with two entirely different samples (i.e., different species with different Illumina read files and different plastome assemblies), yet the error remains the same, indicating a code issue to me. Any idea what might be going on?

mrmckain commented 5 years ago

Hi Michael,

I think I know the issue. Let me do some tests and I will get back with you.

mrmckain commented 5 years ago

Hi Michael,

Sorry for the long delay. I made an update that should fix the issue. Let me know if it doesn't for you.

Best, Michael