get.seq() cannot download multiple sequences

Issue #318 resolved
Yingqian Zhan created an issue

I tried the example on the documentation page. It only downloaded the last sequence.

> get.seq( c("P01112", "Q61411", "P20171") )
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100   462    0   462    0     0   2496      0 --:--:-- --:--:-- --:--:--  2510
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100   443    0   443    0     0   3599      0 --:--:-- --:--:-- --:--:--  3601
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100   441    0   441    0     0   3585      0 --:--:-- --:--:-- --:--:--  3614
                               1        .         .         .         .         50 
[Truncated_Name:1]gi|3419417   MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPTIEDSYRKQVVIDGET
                               1        .         .         .         .         50 

                              51        .         .         .         .         100 
[Truncated_Name:1]gi|3419417   CLLDILDTAGQEEYSAMRDQYMRTGEGFLCVFAINNTKSFEDIHQYREQI
                              51        .         .         .         .         100 

                             101        .         .         .         .         150 
[Truncated_Name:1]gi|3419417   KRVKDSDDVPMVLVGNKCDLAARTVESRQAQDLARSYGIPYIETSAKTRQ
                             101        .         .         .         .         150 

                             151        .         .         .        189 
[Truncated_Name:1]gi|3419417   GVEDAFYTLVREIRQHKLRKLNPPDESGPGCMSCKCVLS
                             151        .         .         .        189 

Call:
  read.fasta(file = outfile)

Class:
  fasta

Alignment dimensions:
  1 sequence rows; 189 position columns (189 non-gap, 0 gap) 

+ attr: id, ali, call
Warning message:
In get.seq(c("P01112", "Q61411", "P20171")) :
  Removing existing file: seqs.fasta
> get.seq( c("4q21", "5p21") )
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100   269    0   269    0     0   1194      0 --:--:-- --:--:-- --:--:--  1200
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100   300    0   300    0     0   1676      0 --:--:-- --:--:-- --:--:--  1685
                      1        .         .         .         .         50 
gi|231162|pdb|5P21|   MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPTIEDSYRKQVVIDGET
                      1        .         .         .         .         50 

                     51        .         .         .         .         100 
gi|231162|pdb|5P21|   CLLDILDTAGQEEYSAMRDQYMRTGEGFLCVFAINNTKSFEDIHQYREQI
                     51        .         .         .         .         100 

                    101        .         .         .         .         150 
gi|231162|pdb|5P21|   KRVKDSDDVPMVLVGNKCDLAARTVESRQAQDLARSYGIPYIETSAKTRQ
                    101        .         .         .         .         150 

                    151        .     166 
gi|231162|pdb|5P21|   GVEDAFYTLVREIRQH
                    151        .     166 

Call:
  read.fasta(file = outfile)

Class:
  fasta

Alignment dimensions:
  1 sequence rows; 166 position columns (166 non-gap, 0 gap) 

+ attr: id, ali, call
Warning message:
In get.seq(c("4q21", "5p21")) : Removing existing file: seqs.fasta

-- R version -- R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"

all other packages are up to date

Comments (6)

  1. Xinqiu Yao

    Hi Yingqian,

    Can you tell us your OS type and bio3d version please?

    It is likely the problem of "default" download method. The officially released bio3d (i.e. v2.2-4 or earlier) assumes the "internal" method, which must be supported by your R build to run functions (e.g. get.seq() and get.pdb()) correctly. Can you try capabilities("http/ftp") and let us know the returned value? If it is FALSE, your R does not support the "internal" method and you may have to think about installing the development version bio3d (Note that the development version supports multiple download methods and should solve your problem here. See here for how to install.)

  2. Yingqian Zhan reporter

    OS : OS X EI Capitan Version 10.11.2 ;

    bio3d: 2.2-4


    > capabilities("http/ftp")
    http/ftp 
        TRUE 
    

    What do you think? Thank you!

  3. Xinqiu Yao

    So you can try

    options(download.file.method='internal')
    get.seq( c("P01112", "Q61411", "P20171") )
    

    Let me know what you get.

  4. Log in to comment