Where the heck is setDataSourceName() called?

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

Where the heck is setDataSourceName() called?

Sam Hokin-3
So I'm trying to add some project.xml parameters to the GFF3 loader that should be there, like DataSource.url. I've got the
following in GFF3ConverterTask.java:

     /**

      * Set the dataSourceName

      * @param dataSourceName the dataSourceName

      */
     public void setDataSourceName(String dataSourceName) {
         // DEBUG

         System.out.println("setDataSourceName "+dataSourceName);
         this.dataSourceName = dataSourceName;
     }

     /**

      * Set the dataSourceUrl

      * @param dataSourceUrl the dataSourceUrl

      */
     public void setDataSourceUrl(String dataSourceUrl) {
         // DEBUG

         System.out.println("setDataSourceUrl "+dataSourceUrl);
         this.dataSourceUrl = dataSourceUrl;
     }

The first DOES get set if I include

<property name="gff3.dataSourceName" value="LIS"/>

in project.xml. Why it has to be prepended with gff3 is a mystery to me and why it's not data.source.name is also a mystery to me.

BUT if I try to set the data source URL with

<property name="gff3.dataSourceUrl" value="https://legumeinfo.org/"/>

or any other stab in the dark, setDataSourceUrl does NOT get called.

Does anyone know where these setters get called? And how you configure them so they DO get called? Thanks!!!
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Where the heck is setDataSourceName() called?

joe carlson

Hi Sam,

Look in intermine/plugin/src/main/groovy/org/intermine/plugin/integrate/IntegrateUtils.groovy

 protected retrieveSingleSource = {sourceName ->
        Source source = imProject.sources.get(sourceName)
        Properties bioSourceProperties = bioSourceProperties.getBioSourceProperties(sourceName)
        if (bioSourceProperties.containsKey("have.file.custom.tgt")) {
            retrieveTgtFromCustomFile(source, bioSourceProperties)
        } else if (bioSourceProperties.containsKey("have.db.tgt")) {
            retrieveTgtFromDB(source, bioSourceProperties)
        } else if (bioSourceProperties.containsKey("have.dir.custom.tgt")) {
            retrieveTgtFromCustomDir(source, bioSourceProperties)
        } else if (bioSourceProperties.containsKey("have.file.xml.tgt")) {
            retrieveTgtFromXMLFile(source, bioSourceProperties)
        } else if (bioSourceProperties.containsKey("have.large.file.xml.tgt")) {
            retrieveTgtFromLargeXMLFile(source, bioSourceProperties)
        } else if (bioSourceProperties.containsKey("have.file.gff3")) {
            retrieveFromGFF3(source, bioSourceProperties)

        } else if (bioSourceProperties.containsKey("have.file.obo")) {
            retrieveFromOBO(source, bioSourceProperties)
        }
        // TODO throw exception here if we haven't found a valid type?
    }
then:

   def retrieveFromGFF3 = {Source source, Properties bioSourceProperties ->
        def ant = new AntBuilder()
        //set dynamic properties
        source.userProperties.each { prop ->
            if (!"src.data.dir".equals(prop.name)) {
                ant.project.setProperty(prop.name, prop.value)
            }
        }
        String gff3SeqHandlerClassName = (bioSourceProperties.containsKey("gff3.seqHandlerClassName")) ?
                bioSourceProperties.getProperty("gff3.seqHandlerClassName") : ""
        String licence = ant.project.getProperty("gff3.licence")

        ant.taskdef(name: "convertGFF3File", classname: "org.intermine.bio.task.GFF3ConverterTask") {
            classpath {
                dirset(dir: gradleProject.getBuildDir().getAbsolutePath())
                pathelement(path: gradleProject.configurations.getByName("compile").asPath)
                pathelement(path: gradleProject.configurations.getByName("integrateSource").asPath)
            }
        }
        ant.convertGFF3File(converter: "org.intermine.bio.dataconversion.GFF3Converter",
                target: "osw." + COMMON_OS_PREFIX + "-tgt-items",
                seqClsName: BioSourceProperties.getUserProperty(source, "gff3.seqClsName"),
                orgTaxonId: BioSourceProperties.getUserProperty(source, "gff3.taxonId"),
                dataSourceName: BioSourceProperties.getUserProperty(source, "gff3.dataSourceName"),
                seqDataSourceName: BioSourceProperties.getUserProperty(source, "gff3.seqDataSourceName"),
                dataSetTitle: BioSourceProperties.getUserProperty(source, "gff3.dataSetTitle"),
                dontCreateLocations: BioSourceProperties.getUserProperty(source, "gff3.dontCreateLocations"),
                model: "genomic",
                handlerClassName: bioSourceProperties.getProperty("gff3.handlerClassName"),
                seqHandlerClassName: gff3SeqHandlerClassName,
                licence: licence) {
            fileset(dir: BioSourceProperties.getUserProperty(source, "src.data.dir"),
                    includes: "*.gff,*.gff3")
        }
    }

joe

On 10/22/19 4:35 PM, Sam Hokin wrote:
So I'm trying to add some project.xml parameters to the GFF3 loader that should be there, like DataSource.url. I've got the following in GFF3ConverterTask.java:

    /**
     * Set the dataSourceName
     * @param dataSourceName the dataSourceName
     */
    public void setDataSourceName(String dataSourceName) {
        // DEBUG
        System.out.println("setDataSourceName "+dataSourceName);
        this.dataSourceName = dataSourceName;
    }

    /**
     * Set the dataSourceUrl
     * @param dataSourceUrl the dataSourceUrl
     */
    public void setDataSourceUrl(String dataSourceUrl) {
        // DEBUG
        System.out.println("setDataSourceUrl "+dataSourceUrl);
        this.dataSourceUrl = dataSourceUrl;
    }

The first DOES get set if I include

<property name="gff3.dataSourceName" value="LIS"/>

in project.xml. Why it has to be prepended with gff3 is a mystery to me and why it's not data.source.name is also a mystery to me.

BUT if I try to set the data source URL with

<property name="gff3.dataSourceUrl" value="https://legumeinfo.org/"/>

or any other stab in the dark, setDataSourceUrl does NOT get called.

Does anyone know where these setters get called? And how you configure them so they DO get called? Thanks!!!
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev