Thank you, Pierre! I tried and it gives an error:
[W::fai_get_val] Reference ch1 not found in FASTA file, returning empty sequence
[faidx] Failed to fetch sequence in ch1
[W::fai_get_val] Reference ch1 not found in FASTA file, returning empty sequence
[faidx] Failed to fetch sequence in ch1
[W::fai_get_val] Reference ch1 not found in FASTA file, returning empty sequence
[faidx] Failed to fetch sequence in ch1
The chromosome names in each of the fasta files are like: sample1_rhg1.0ch1 sample2_rhg1.0ch1 sample3_rhg1.0ch1
How can I mention that in the loop so that it recognizes ch1 in each of the fasta file? Thank you!
if this format is correct,
ch1 is sample1_rhg1.0ch1 in sample1.fasta.gz and ch1 is sample2_rhg1.0ch1 in sample2.fasta.gz, try:with seqkit (dry-run)
New files would be in
stdin.splitdirectory. File names would bestdin.id_ch1.fasta,stdin.id_ch2.fastafor eachchand each fasta sequence name will be exactly as it is in eachchfasta. For eg.>sample1_rhg1.0ch1and>sample2_rhg1.0ch1forch1. Download seqkit from https://bioinf.shenwei.me/seqkit/download/. Removedfrom-dionce you are okay with dry-run output.without seqkit (assuming that sequences are flattened and all files have equal number
chentities)Files would be named
ch1.fasta,ch2.fastaetc.