Entering edit mode
                    9.9 years ago
        dago
        
    
        ★
    
    2.8k
    I have a multifasta file from which I want to extract some sequences using IDs.
Multifasta example:
>NITMOv2_RS22300
MAKTVAVVIREDPRRTHRPVEALRIALGLVAGNHATTVVLLNEAARLLSEDTDDVVDVEI
LEKYLPSIQQLEVPFVLPEFIDRSGVRTDFAVRYESDDTIRRLLQSMDRTLVF
>NITMOv2_RS22305
MSLSSSVYLIRKSAAALSPTLYVSGDSDWVVVEIGEDKRSSDYRELLELVLHAEKVITL
IDs example:
NITINOP_v2_3300
NITINOP_v2_3307
I usually do this using the following command
xargs faidx -d "" MULTIFASTA < IDs
It always worked fine, but with some new files it started to give me the following error I cannot understand:
Traceback (most recent call last):
  File "/usr/local/bin/faidx", line 9, in <module>
    load_entry_point('pyfaidx==0.3.4', 'console_scripts', 'faidx')()
  File "/usr/local/lib/python2.7/dist-packages/pyfaidx/cli.py", line 132, in main
    write_sequence(args)
  File "/usr/local/lib/python2.7/dist-packages/pyfaidx/cli.py", line 33, in write_sequence
    fasta = Fasta(args.fasta, default_seq=args.default_seq, strict_bounds=not args.lazy, split_char=args.delimiter)
  File "/usr/local/lib/python2.7/dist-packages/pyfaidx/__init__.py", line 527, in __init__
    read_ahead=read_ahead, mutable=mutable, split_char=split_char)
  File "/usr/local/lib/python2.7/dist-packages/pyfaidx/__init__.py", line 218, in __init__
    raise FastaIndexingError(e)
Any suggestion, what am I missing here?
Alternatively you can use
faSomeRecords,Here is how A: perl code to extract sequences from multi-line fasta works on all test files but
Thanks very much. This is another good option I guess.
However, whenever I try to run it I get the following error:
I try to look into the code but I cannot even open it. Any suggestion?
EDIT
I did not make it executable...sorry! Thanks it worked!