Are there any best-practices or gotchas for using ...
# nextflow-plugins
n
Are there any best-practices or gotchas for using code from plugins in another plugin? I'm trying this but it's not really doing what I want 😁
inception 2
b
I'm not sure if it's possible to import a plugin as a library into another plugin. It is a JAR and if it's published to a registry like Maven Central, it should be possible... maybe @Jorge knows better
failing that, you can just copy the code into your plugin 👀
n
I managed to get it working! I needed some code of the
nf-amazon
plugin to easily get the resource URL of an s3 Path
b
okay I had a feeling you would say that. in that case you can just use the
Path
interface and Nextflow should resolve it for you
💯 1
j
IMHO is not a good idea create this kind of dependencies
👍 2
n
The problem was that the
Path
interface didn't have the functionality to get the resource URL. I had to create an
AmazonS3
object and use it to get the resource URL like this:
Copy code
s3Client.getResourceUrl(destPath.bucket, destPath.key)
So yeah I'm also using the
Path
interface in this case 😛
b
what is the resource URL?
n
It's the HTTPS equivalent of the S3 URI. So for example
<s3://test/file.txt>
can also be noted as
<https://test.s3.amazonaws.com/file.txt>
or some other variant dependent on the S3 host
b
I see. Indeed the path interface won't help you there, you'll need to use the S3 SDK or compute it yourself
n
Indeed, so that's why I used the
nf-amazon
plugin so I don't have to redo the configuration setup etc 🙂
b
By the way, are you working on DRS support? I thought I saw some hint of that in another slack thread. If so, you might consider adding it to the nf-ga4gh plugin which has now been separated from core Nextflow: https://github.com/nextflow-io/nf-ga4gh
n
Yes that's exactly what I'm doing. Our version of the DRS API however does not fully match with the official API schema. We however are planning on updating this some time in the future. I'll definitely make the plugin public or add the code to nf-ga4gh once that's the case 🙂
👍 1
I'm also only adding support for the creation of DRS objects so it's definitely not a feature complete plugin at this point 🙂
b
I think it would be a sensible goal to only support DRS upload or download as a first step anyway, whichever one is easier / more useful
👍 1
n
Allright I'll let you know once we're ready to make it public
(I'll also be happy to provide some snippets and help ff development on that were to start before we can make it public)