Sequence file extraction
2
0
Entering edit mode
2.2 years ago
zhichusun ▴ 10

I have a folder containing 5000 fasta files, I want to extract the corresponding fasta files in txt according to a txt file, for example, 100989.fasta 84649.fasta 43985.fasta,is included in the list How do I extract and save to a new folder? I have used seqkit grep -n -f 2.list *.fasta > 2 code but no output result. Thanks a lot for your help

extraction • 701 views
ADD COMMENT
2
Entering edit mode
2.2 years ago
$ parallel --plus --dry-run cp {} newfolder/{} :::: list.txt

Remove dry-run if you are okay with dry run (dummy) execution. Always post data to address the issue. In this context, partial tree (folder contents) and content of text files would have helped addressing the issue better.

ADD COMMENT
1
Entering edit mode
2.2 years ago

Just use while loop.

$ tree 
.
├── 2/
├── 2.list
└── folder/
    ├── 100989.fasta
    ├── 43985.fasta
    ├── 84649.fasta
    └── 9606.fasta

$ cat 2.list | while read f; do cp folder/$f 2/; done

$ tree 
.
├── 2
│   ├── 100989.fasta
│   ├── 43985.fasta
│   └── 84649.fasta
├── 2.list
└── folder
    ├── 100989.fasta
    ├── 43985.fasta
    ├── 84649.fasta
    └── 9606.fasta
ADD COMMENT
0
Entering edit mode

this is a good way thanks a lot.

ADD REPLY

Login before adding your answer.

Traffic: 2317 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6