How to load fasta file with openPrimeR?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to load fasta file with openPrimeR?

Luigi
Hello,
I am trying to load a fast file with the package 'openPrimeR'. The
manual (https://www.bioconductor.org/packages/release/bioc/vignettes/openPrimeR/inst/doc/openPrimeR_vignette.html)
says to use:
```
fasta.file <- system.file("extdata", "IMGT_data", "templates",
                "Homo_sapiens_IGH_functional_exon.fasta", package =
"openPrimeR")
# Load the template sequences from 'fasta.file'
seq.df.simple <- read_templates(fasta.file)
```
but if I give these commands to a local file:
```
fasta.file <- system.file("extdata", "IMGT_data", "templates",
                "stx.fa", package = "openPrimeR")
fasta.file <- system.file("stx.fa", package = "openPrimeR")
```
where stx.fa il the file I wanted to open and that is present in the
working directly. I get only an empty object.
What am I getting wrong?
Thank you


--
Best regards,
Luigi

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: How to load fasta file with openPrimeR?

Bert Gunter-2
As this is a Bioconductor package, why not ask on their support page:

https://support.bioconductor.org/



Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Mon, Feb 15, 2021 at 10:11 AM Luigi Marongiu <[hidden email]>
wrote:

> Hello,
> I am trying to load a fast file with the package 'openPrimeR'. The
> manual (
> https://www.bioconductor.org/packages/release/bioc/vignettes/openPrimeR/inst/doc/openPrimeR_vignette.html
> )
> says to use:
> ```
> fasta.file <- system.file("extdata", "IMGT_data", "templates",
>                 "Homo_sapiens_IGH_functional_exon.fasta", package =
> "openPrimeR")
> # Load the template sequences from 'fasta.file'
> seq.df.simple <- read_templates(fasta.file)
> ```
> but if I give these commands to a local file:
> ```
> fasta.file <- system.file("extdata", "IMGT_data", "templates",
>                 "stx.fa", package = "openPrimeR")
> fasta.file <- system.file("stx.fa", package = "openPrimeR")
> ```
> where stx.fa il the file I wanted to open and that is present in the
> working directly. I get only an empty object.
> What am I getting wrong?
> Thank you
>
>
> --
> Best regards,
> Luigi
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: How to load fasta file with openPrimeR?

Bill Dunlap-2
In reply to this post by Luigi
> but if I give these commands to a local file:
> ```
> fasta.file <- system.file("extdata", "IMGT_data", "templates",
>                 "stx.fa", package = "openPrimeR")
> fasta.file <- system.file("stx.fa", package = "openPrimeR")
> ```
> where stx.fa il the file I wanted to open and that is present in the
> working directly. I get only an empty object.

If "stx.fa" is in fact in the current working directory then use
   fasta.file <- "stx.fa"
system.file() is for accessing files in installed packages.

-Bill

On Mon, Feb 15, 2021 at 10:11 AM Luigi Marongiu
<[hidden email]> wrote:

>
> Hello,
> I am trying to load a fast file with the package 'openPrimeR'. The
> manual (https://www.bioconductor.org/packages/release/bioc/vignettes/openPrimeR/inst/doc/openPrimeR_vignette.html)
> says to use:
> ```
> fasta.file <- system.file("extdata", "IMGT_data", "templates",
>                 "Homo_sapiens_IGH_functional_exon.fasta", package =
> "openPrimeR")
> # Load the template sequences from 'fasta.file'
> seq.df.simple <- read_templates(fasta.file)
> ```
> but if I give these commands to a local file:
> ```
> fasta.file <- system.file("extdata", "IMGT_data", "templates",
>                 "stx.fa", package = "openPrimeR")
> fasta.file <- system.file("stx.fa", package = "openPrimeR")
> ```
> where stx.fa il the file I wanted to open and that is present in the
> working directly. I get only an empty object.
> What am I getting wrong?
> Thank you
>
>
> --
> Best regards,
> Luigi
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: How to load fasta file with openPrimeR?

Luigi
In reply to this post by Bert Gunter-2
I think the problem is system.file, which is R base, but I'll go for
bioconductor. Thanks

On Mon, Feb 15, 2021 at 7:18 PM Bert Gunter <[hidden email]> wrote:

>
> As this is a Bioconductor package, why not ask on their support page:
>
> https://support.bioconductor.org/
>
>
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Mon, Feb 15, 2021 at 10:11 AM Luigi Marongiu <[hidden email]> wrote:
>>
>> Hello,
>> I am trying to load a fast file with the package 'openPrimeR'. The
>> manual (https://www.bioconductor.org/packages/release/bioc/vignettes/openPrimeR/inst/doc/openPrimeR_vignette.html)
>> says to use:
>> ```
>> fasta.file <- system.file("extdata", "IMGT_data", "templates",
>>                 "Homo_sapiens_IGH_functional_exon.fasta", package =
>> "openPrimeR")
>> # Load the template sequences from 'fasta.file'
>> seq.df.simple <- read_templates(fasta.file)
>> ```
>> but if I give these commands to a local file:
>> ```
>> fasta.file <- system.file("extdata", "IMGT_data", "templates",
>>                 "stx.fa", package = "openPrimeR")
>> fasta.file <- system.file("stx.fa", package = "openPrimeR")
>> ```
>> where stx.fa il the file I wanted to open and that is present in the
>> working directly. I get only an empty object.
>> What am I getting wrong?
>> Thank you
>>
>>
>> --
>> Best regards,
>> Luigi
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.



--
Best regards,
Luigi

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: How to load fasta file with openPrimeR?

Luigi
In reply to this post by Bill Dunlap-2
Thank you. it looks like it worked:
```

> fasta.file <- "stx.fa"
> seq.df <- read_templates(fasta.file)
> fasta.file
[1] "stx.fa"
> seq.df
                       ID                  Header   Group Identifier
Sequence_Length Allowed_Start_fw Allowed_End_fw
1 >MW311073.1 Escheric... >MW311073.1 Escheric... default          1
          180                1             30
  Allowed_Start_rev Allowed_End_rev              Allowed_fw
 Allowed_rev Allowed_Start_fw_ali
1               151             180 atgaagaagatgtttatggc...
cgctggaatctgcaaccgtt...                    1
  Allowed_End_fw_ali Allowed_Start_fw_initial Allowed_End_fw_initial
Allowed_Start_fw_initial_ali
1                 30                        1                     30
                         1
  Allowed_End_fw_initial_ali Allowed_Start_rev_ali Allowed_End_rev_ali
Allowed_Start_rev_initial
1                         30                   151                 180
                      151
  Allowed_End_rev_initial Allowed_Start_rev_initial_ali
Allowed_End_rev_initial_ali                Sequence
1                     180                           151
         180 atgaagaagatgtttatggc...
            InputSequence Run
1 atgaagaagatgtttatggc... stx
```
When the original file stx.fa is:
```
>MW311073.1 Escherichia coli strain XP2F shiga toxin 2 (stx2) gene, partial cds
ATGAAGAAGATGTTTATGGCGGTTTTATTTGCATTAGTTTCTGTTAATGCAATGGCGGCGGATTGCGCTA
AAGGTAAAATTGAGTTTTCCAAGTATAATGAGAATGATACATTCACAGTAAAAGTGGCCGGAAAAGAGTA
CTGGACCAGTCGCTGGAATCTGCAACCGTTACTGCAAAGT
```

On Mon, Feb 15, 2021 at 7:28 PM Bill Dunlap <[hidden email]> wrote:

>
> > but if I give these commands to a local file:
> > ```
> > fasta.file <- system.file("extdata", "IMGT_data", "templates",
> >                 "stx.fa", package = "openPrimeR")
> > fasta.file <- system.file("stx.fa", package = "openPrimeR")
> > ```
> > where stx.fa il the file I wanted to open and that is present in the
> > working directly. I get only an empty object.
>
> If "stx.fa" is in fact in the current working directory then use
>    fasta.file <- "stx.fa"
> system.file() is for accessing files in installed packages.
>
> -Bill
>
> On Mon, Feb 15, 2021 at 10:11 AM Luigi Marongiu
> <[hidden email]> wrote:
> >
> > Hello,
> > I am trying to load a fast file with the package 'openPrimeR'. The
> > manual (https://www.bioconductor.org/packages/release/bioc/vignettes/openPrimeR/inst/doc/openPrimeR_vignette.html)
> > says to use:
> > ```
> > fasta.file <- system.file("extdata", "IMGT_data", "templates",
> >                 "Homo_sapiens_IGH_functional_exon.fasta", package =
> > "openPrimeR")
> > # Load the template sequences from 'fasta.file'
> > seq.df.simple <- read_templates(fasta.file)
> > ```
> > but if I give these commands to a local file:
> > ```
> > fasta.file <- system.file("extdata", "IMGT_data", "templates",
> >                 "stx.fa", package = "openPrimeR")
> > fasta.file <- system.file("stx.fa", package = "openPrimeR")
> > ```
> > where stx.fa il the file I wanted to open and that is present in the
> > working directly. I get only an empty object.
> > What am I getting wrong?
> > Thank you
> >
> >
> > --
> > Best regards,
> > Luigi
> >
> > ______________________________________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.



--
Best regards,
Luigi

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.