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

CONSISTENT ERROR -FastaIndex: Record has inconsistent line lengths or line endings #8

Open
desmodus1984 opened this issue Jan 3, 2022 · 2 comments

Comments

@desmodus1984
Copy link

Hi.
I built an assembly and I am trying to polish it with apollo.
I installed it as told, and followed all the steps.
I converted the fastq files into fasta one-liners
head reads2.fasta

V300066187L4C001R0010000000/2
GTGTCAGATGTGTTATATAGCTTGATTTTAACCATTTAACCAATACATACATGAAGATATATACCCCAAATATATGCCATTTGTGTCAAGTATACCTGAA
V300066187L4C001R0010000014/2
ATCTGTATTTATACCAATTGATTTTAATCCTGTCAATTTCTATCGCAAAGGTTAGGGCGTTTCTTATCTCCATTCCAGGGAGTAAAGATTATGTAGCTTA
V300066187L4C001R0010000017/2
AAAGCTGCGCCCAAAACTCCCACCCGGCTAGACAGTTCAGTTCCTCTCCATATGTCACTGGATTTCCCCAAAGCCACTACCTGGTGCTGGAGCTCACCGG
V300066187L4C001R0010000029/2
GTTTCTGTTGAGAAATCGTTTGATAATCTGATGGGGGATCCTTTGTAGGTAACTCTCTGTTTCTCTCTTGCTGCCTTTAAGATTCTCTCTTTGTCTTGAA
V300066187L4C001R0010000038/2
TCTCACACTGATATTTTTTTCTCTCTCTCCCCTTCTCTCTCTCTCTAAAATCAATAAACATACCTTTGGGTGAGGATAAACAGAATAGTGCTTGTTTCTC

I did convert the sam to bam and sorted it and indexed it
/users/PHS0338/jpac1984/appz/bwa-mem2-2.2.1_x64-linux/bwa-mem2 mem -t 48 Hapo -R '@RG\tID:PA113-1\tSM:bar\tPL:DNBSEQ' \ /fs/scratch/PHS0338/BGI-reads/reads_1.fq > PA113-1.sam /fs/scratch/PHS0338/appz/samtools-1.14/samtools view -hb -@ 48 PA113-1.sam > PA113-1.bam /fs/scratch/PHS0338/appz/samtools-1.14/samtools view -h -@ 48 -F4 PA113-1.bam | /fs/scratch/PHS0338/appz/samtools-1.14/samtools sort -@ 48 -m 3G -O bam -o PA113-1.sorted.bam /fs/scratch/PHS0338/appz/samtools-1.14/samtools index -@ 12 PA113-1.sorted.bam

And I get the same SeqAn error that I do not know how to fix it.

The log:
Assembly: /users/PHS0338/jpac1984/data/myse-hapog.fasta
Pair of a set of reads and their alignments:
/fs/scratch/PHS0338/BGI-reads/reads1.fasta, /fs/scratch/PHS0338/appz/sam-bams/PA113-1.sorted.bam
/fs/scratch/PHS0338/BGI-reads/reads2.fasta, /fs/scratch/PHS0338/appz/sam-bams/PA113-2.sorted.bam
Output file: myse-polished.fasta
Maximum consecutive insertions: 3
Maximum consecutive deletions: 10
Transition probability to match states: 0.85
Transition probability to insertion states: 0.1
Overall deletion transition probabilities from a state: 0.05
Deletion transition factor: 2.5
Emission probability of a matching character: 0.97
Emission probability of a substitution (i.e., mismatch) character: 0.01
Emission probability of an inserted character: 0.333333
Filter size: 100
Viterbi filter size: 5
Viterbi batch size: 5000
Read chunking size (0 for original length): 1000
Max thread: 48
terminate called after throwing an instance of 'seqan::ParseError'
what(): FastaIndex: Record has inconsistent line lengths or line endings
/var/spool/slurmd/job8594593/slurm_script: line 10: 45058 Aborted (core dumped) bin/apollo -a /users/PHS0338/jpac1984/data/myse-hapog.fasta -r /fs/scratch/PHS0338/BGI-reads/reads1.fasta -r /fs/scratch/PHS0338/BGI-reads/reads2.fasta -m /fs/scratch/PHS0338/appz/sam-bams/PA113-1.sorted.bam -m /fs/scratch/PHS0338/appz/sam-bams/PA113-2.sorted.bam -t 48 -o myse-polished.fasta

Any idea of why it is failing all the time?
I have all the input files are required and it fails.

@canfirtina
Copy link
Member

Hi @desmodus1984,

Seems like the sequence identifiers (headers) do not start with '>', which is probably a must for SeqAn to parse and index the FASTA file properly. Can you try adding '>' to the beginning of sequence identifiers and rerunning Apollo again? I would also check the encoding of your text file and some unexpected hidden characters that you may have in your line endings, which may be messing up with your FASTA file.

You can potentially use seqtk seq to convert your FASTA file in a way that Apollo requires. It would hopefully resolve the issues that you may experience regarding formatting and line endings.

Best,

Can Firtina

@desmodus1984
Copy link
Author

desmodus1984 commented Jan 3, 2022 via email

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