Skip to content

Script generates an empty file. #541

@desmodus1984

Description

@desmodus1984

Hi,
I need to process some fasta files for doing synteny analysis and I used seqkit and it generated empty files.
The script is this:

for i in *.fasta
        do
        base=$(basename $i ".fasta")

#Rename sequences
seqkit replace -p "(.*)" --replacement "${base}CHR" ${base}.fasta > ${base}-ren.fasta

head ${base}-ren.fasta

#Sort by length
seqkit sort -l -r ${base}-ren.fasta > ${base}-ren.fasta

#Filter by length min 1M
seqkit seq -m 1000000 -g ${base}-ren.fasta > ${base}-1M.fasta

# Check stats
seqkit stats ${base}-1M.fasta

I saw it first generating some files but then the first became empty.
3198678242 Jun 13 15:51 LWed.fasta
2450740935 Jun 13 16:00 NSch.fasta
2460756707 Jul 11 10:43 MAng.fasta
2495284749 Jul 14 14:27 HLep.fasta
2485064101 Sep 22 12:17 HL2.fasta
1323 Sep 22 17:48 chromsync-prep.sh.save
1463 Sep 22 18:01 chromsync-prep.sh
0 Sep 22 18:05 HL2-ren.fasta
0 Sep 22 18:05 HL2-1M.fasta
0 Sep 22 18:06 HLep-ren.fasta
0 Sep 22 18:06 HLep-1M.fasta
0 Sep 22 18:07 LWed-ren.fasta
0 Sep 22 18:07 LWed-1M.fasta
0 Sep 22 18:08 MAng-ren.fasta
0 Sep 22 18:08 MAng-1M.fasta
0 Sep 22 18:09 NSch-ren.fasta
0 Sep 22 18:09 NSch-1M.fasta

Any reason for this?
Is it possible to pipe the different commands to generate the sorted/filtered/renames files?

Thanks;

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions