matR icon indicating copy to clipboard operation
matR copied to clipboard

Setting authorization key matR

Open Djeppschmidt opened this issue 6 years ago • 8 comments

I used matR a couple years ago with no problem. I'm now trying to use it again to access another MG-Rast dataset, and I'm getting a peculiar error when I'm trying to set up my authorization key. I've noticed that the package has changed a lot since I last used it, and I'm wondering if this feature has changed. Here's the code with the error:

library(matR) msession$setAuth("~/Downloads/MGRastAuth.txt") Error: object 'msession' not found

I've tried reinstalling matR a couple times in case it was a compilation error. I'm running OSX 10.13.4, and R 3.4.4.

Any insight is greatly appreciated!

-Dietrich

Djeppschmidt avatar Oct 12 '18 14:10 Djeppschmidt

The syntax for specifying the authentication token has changed.

auth.MGRAST(file="~/Downloads/MGRastAuth.txt")

will do what you want.

wltrimbl avatar Oct 12 '18 14:10 wltrimbl

Thanks; now I get this error:

library(matR) auth.MGRAST() Error in auth.MGRAST() : could not find function "auth.MGRAST"

Dietrich Epp Schmidt, PhD Candidate Graduate Research Assistant UMD Environmental Science and Technology www.humaneecology.com http://www.humaneecology.com

*“Whether we and our politicians know it or not, Nature is party to all our deals and decisions, and she has more votes, a longer memory, and a sterner sense of justice than we do.” *

Wendell Berry

http://www.goodreads.com/author/show/8567.Wendell_Berry

On Fri, Oct 12, 2018 at 10:34 AM Will Trimble [email protected] wrote:

The syntax for specifying the authentication token has changed.

auth.MGRAST(file="~/Downloads/MGRastAuth.txt")

will do what you want.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MG-RAST/matR/issues/82#issuecomment-429347119, or mute the thread https://github.com/notifications/unsubscribe-auth/ASZbjCO67AyUVonUZ2B50TXdLC4UR_ktks5ukKh_gaJpZM4XZkBk .

Djeppschmidt avatar Oct 12 '18 14:10 Djeppschmidt

You have a version of matR that is too old. Reinstall 0.9.1 from CRAN or use the instructions at https://github.com/MG-RAST/matR

sessionInfo(matR)
other attached packages:
[1] matR_0.9

wltrimbl avatar Oct 12 '18 15:10 wltrimbl

I've tried both approaches, still same problem.

library(matR) Loading required package: BIOM.utils BIOM.utils (0.9 dbcb27) matR: metagenomics analysis tools for R (0.9.1) auth.MGRAST() Error in auth.MGRAST() : could not find function "auth.MGRAST"

Installation from GitHub: matR * 0.9.1 2018-10-12 Github (MG-RAST/matR@0c0b556) MGRASTer * 0.9 2014-08-02 CRAN (R 3.4.0)

Installation from CRAN: matR * 0.9.1 2018-05-04 CRAN (R 3.4.4) MGRASTer * 0.9 2014-08-02 CRAN (R 3.4.0)

I have also run an update through bioconductor to make sure the dependencies are up to date.

Thanks, Dietrich Epp Schmidt, PhD Candidate Graduate Research Assistant UMD Environmental Science and Technology www.humaneecology.com http://www.humaneecology.com

*“Whether we and our politicians know it or not, Nature is party to all our deals and decisions, and she has more votes, a longer memory, and a sterner sense of justice than we do.” *

Wendell Berry

http://www.goodreads.com/author/show/8567.Wendell_Berry

On Fri, Oct 12, 2018 at 11:18 AM Will Trimble [email protected] wrote:

You have a version of matR that is too old. Reinstall 0.9.1 from CRAN or use the instructions at https://github.com/MG-RAST/matR

sessionInfo(matR) other attached packages: [1] matR_0.9

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MG-RAST/matR/issues/82#issuecomment-429361944, or mute the thread https://github.com/notifications/unsubscribe-auth/ASZbjLuEQstieFa4jCIbn5NZWYYmPJz4ks5ukLLVgaJpZM4XZkBk .

Djeppschmidt avatar Oct 12 '18 15:10 Djeppschmidt

Do you have the auth.MGRAST() function code in github? I didn't see it but I could try writing it into the environment manually for a quick fix.

Thanks, Dietrich Epp Schmidt, PhD Candidate Graduate Research Assistant UMD Environmental Science and Technology www.humaneecology.com http://www.humaneecology.com

*“Whether we and our politicians know it or not, Nature is party to all our deals and decisions, and she has more votes, a longer memory, and a sterner sense of justice than we do.” *

Wendell Berry

http://www.goodreads.com/author/show/8567.Wendell_Berry

On Fri, Oct 12, 2018 at 11:44 AM Dietrich Epp Schmidt < [email protected]> wrote:

I've tried both approaches, still same problem.

library(matR) Loading required package: BIOM.utils BIOM.utils (0.9 dbcb27) matR: metagenomics analysis tools for R (0.9.1) auth.MGRAST() Error in auth.MGRAST() : could not find function "auth.MGRAST"

Installation from GitHub: matR * 0.9.1 2018-10-12 Github (MG-RAST/matR@0c0b556) MGRASTer * 0.9 2014-08-02 CRAN (R 3.4.0)

Installation from CRAN: matR * 0.9.1 2018-05-04 CRAN (R 3.4.4) MGRASTer * 0.9 2014-08-02 CRAN (R 3.4.0)

I have also run an update through bioconductor to make sure the dependencies are up to date.

Thanks, Dietrich Epp Schmidt, PhD Candidate Graduate Research Assistant UMD Environmental Science and Technology www.humaneecology.com http://www.humaneecology.com

*“Whether we and our politicians know it or not, Nature is party to all our deals and decisions, and she has more votes, a longer memory, and a sterner sense of justice than we do.” *

Wendell Berry

http://www.goodreads.com/author/show/8567.Wendell_Berry

On Fri, Oct 12, 2018 at 11:18 AM Will Trimble [email protected] wrote:

You have a version of matR that is too old. Reinstall 0.9.1 from CRAN or use the instructions at https://github.com/MG-RAST/matR

sessionInfo(matR) other attached packages: [1] matR_0.9

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MG-RAST/matR/issues/82#issuecomment-429361944, or mute the thread https://github.com/notifications/unsubscribe-auth/ASZbjLuEQstieFa4jCIbn5NZWYYmPJz4ks5ukLLVgaJpZM4XZkBk .

Djeppschmidt avatar Oct 12 '18 15:10 Djeppschmidt

The source is here: https://github.com/MG-RAST/MGRASTer/blob/master/R/source.R

So the auth function requires MGRASTer 0.9.1, which isn't in CRAN at the moment.

Sorry to have inconvenienced you with unclearly-versioned dependencies.

wltrimbl avatar Oct 12 '18 16:10 wltrimbl

Ok progress!

Version 0.9 of call.MGRAST was not appending the key to the URL, so I had to manually load all the updated functions so they were consistent. It seems to at least partially be working; it is granted initial access and downloads 33.1 MB of data, but somehow also isn't granted access to the data and doesn't write the data to the specified file. Here's the error:

call.MGRAST("annot", "seq", id=4679418.3, eval=10, type="ont", source="Sub", destfile = "~/Desktop/006.biom") trying URL ' http://api.metagenomics.anl.gov/1/annotation/sequence/mgm4679418.3?evalue=10&type=ontology&source=Subsystems&auth=gbdwiyCZqACamvn8fG59aTs3Z ' downloaded 33.1 MB

Error retrieving URL: simpleWarning in download.file(call.url, destfile = destfile, quiet = FALSE): URL ' http://api.metagenomics.anl.gov/1/annotation/sequence/mgm4679418.3?evalue=10&type=ontology&source=Subsystems&auth=gbdwiyCZqACamvn8fG59aTs3Z': status was 'Failure when receiving data from the peer' URL requested: http://api.metagenomics.anl.gov/1/annotation/sequence/mgm4679418.3?evalue=10&type=ontology&source=Subsystems&auth=gbdwiyCZqACamvn8fG59aTs3Z

HTTP Response: 2: {"ERROR":"insufficient permissions to view this data"}

1: download.file call.url destfile FALSE [1] "~/Desktop/006.biom" Warning message: MGRASTer: saving to file unimplemented with 'parse' and 'verify'; ignoring these

I know the key is correct because I can access the data via a web interface using the same URL that matR uses to query e.g. http://api.metagenomics.anl.gov/1/annotation/sequence/mgm4679418.3?evalue=10&type=ontology&source=Subsystems&auth=gbdwiyCZqACamvn8fG59aTs3Z

so it seems to me that there is something in reading and writing the data that isn't working for me now. Any thoughts?

Thanks,

Dietrich Epp Schmidt, PhD Candidate Graduate Research Assistant UMD Environmental Science and Technology www.humaneecology.com http://www.humaneecology.com

*“Whether we and our politicians know it or not, Nature is party to all our deals and decisions, and she has more votes, a longer memory, and a sterner sense of justice than we do.” *

Wendell Berry

http://www.goodreads.com/author/show/8567.Wendell_Berry

On Fri, Oct 12, 2018 at 12:03 PM Will Trimble [email protected] wrote:

The source is here: https://github.com/MG-RAST/MGRASTer/blob/master/R/source.R

So the auth function requires MGRASTer 0.9.1, which isn't in CRAN at the moment.

Sorry to have inconvenienced you with unclearly-versioned dependencies.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MG-RAST/matR/issues/82#issuecomment-429376512, or mute the thread https://github.com/notifications/unsubscribe-auth/ASZbjHKXXQFRkXtPy8v5TYpuQjSupz1iks5ukL1ugaJpZM4XZkBk .

Djeppschmidt avatar Oct 12 '18 18:10 Djeppschmidt

Never mind... I can download just fine with your code. It just wasn't able to write over old versions of the file 006.biom. Once I deleted, it worked just fine.

Thanks, Dietrich Epp Schmidt, PhD Candidate Graduate Research Assistant UMD Environmental Science and Technology www.humaneecology.com http://www.humaneecology.com

*“Whether we and our politicians know it or not, Nature is party to all our deals and decisions, and she has more votes, a longer memory, and a sterner sense of justice than we do.” *

Wendell Berry

http://www.goodreads.com/author/show/8567.Wendell_Berry

On Fri, Oct 12, 2018 at 2:52 PM Dietrich Epp Schmidt [email protected] wrote:

Ok progress!

Version 0.9 of call.MGRAST was not appending the key to the URL, so I had to manually load all the updated functions so they were consistent. It seems to at least partially be working; it is granted initial access and downloads 33.1 MB of data, but somehow also isn't granted access to the data and doesn't write the data to the specified file. Here's the error:

call.MGRAST("annot", "seq", id=4679418.3, eval=10, type="ont", source="Sub", destfile = "~/Desktop/006.biom") trying URL ' http://api.metagenomics.anl.gov/1/annotation/sequence/mgm4679418.3?evalue=10&type=ontology&source=Subsystems&auth=gbdwiyCZqACamvn8fG59aTs3Z ' downloaded 33.1 MB

Error retrieving URL: simpleWarning in download.file(call.url, destfile = destfile, quiet = FALSE): URL ' http://api.metagenomics.anl.gov/1/annotation/sequence/mgm4679418.3?evalue=10&type=ontology&source=Subsystems&auth=gbdwiyCZqACamvn8fG59aTs3Z': status was 'Failure when receiving data from the peer' URL requested: http://api.metagenomics.anl.gov/1/annotation/sequence/mgm4679418.3?evalue=10&type=ontology&source=Subsystems&auth=gbdwiyCZqACamvn8fG59aTs3Z

HTTP Response: 2: {"ERROR":"insufficient permissions to view this data"}

1: download.file call.url destfile FALSE [1] "~/Desktop/006.biom" Warning message: MGRASTer: saving to file unimplemented with 'parse' and 'verify'; ignoring these

I know the key is correct because I can access the data via a web interface using the same URL that matR uses to query e.g. http://api.metagenomics.anl.gov/1/annotation/sequence/mgm4679418.3?evalue=10&type=ontology&source=Subsystems&auth=gbdwiyCZqACamvn8fG59aTs3Z

so it seems to me that there is something in reading and writing the data that isn't working for me now. Any thoughts?

Thanks,

Dietrich Epp Schmidt, PhD Candidate Graduate Research Assistant UMD Environmental Science and Technology www.humaneecology.com http://www.humaneecology.com

*“Whether we and our politicians know it or not, Nature is party to all our deals and decisions, and she has more votes, a longer memory, and a sterner sense of justice than we do.” *

Wendell Berry

http://www.goodreads.com/author/show/8567.Wendell_Berry

On Fri, Oct 12, 2018 at 12:03 PM Will Trimble [email protected] wrote:

The source is here: https://github.com/MG-RAST/MGRASTer/blob/master/R/source.R

So the auth function requires MGRASTer 0.9.1, which isn't in CRAN at the moment.

Sorry to have inconvenienced you with unclearly-versioned dependencies.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MG-RAST/matR/issues/82#issuecomment-429376512, or mute the thread https://github.com/notifications/unsubscribe-auth/ASZbjHKXXQFRkXtPy8v5TYpuQjSupz1iks5ukL1ugaJpZM4XZkBk .

Djeppschmidt avatar Oct 15 '18 19:10 Djeppschmidt