GMOD / jbrowse-plugin-quantseq

External JB2 plugin implementing a QuantitativeSequence track for displaying base-resolution models.
https://www.npmjs.com/package/jbrowse-plugin-quantseq
Apache License 2.0
1 stars 0 forks source link

Problem parsing config file #4

Closed anamariaelek closed 4 months ago

anamariaelek commented 4 months ago

Firstly, thanks for making this type of visualization possible, it is fantastic to have this option in JBrowse2.

However, I cannot seem to get the config right. Firstly, I had to put plugins block inside the configuration block (as opposed to the top-most level in the config file, as I understood from the documentation). Is the rest of the config structure up to date? For me, specifying files as indicated in the README results in the generic error Failed to load element...Failed element had snapshot

{
  "type": "QuantitativeTrack",
  "trackId": "bias_neuron_Pou4_FoxL2_2.profile_scores.bw",
  "name": "bias_neuron_Pou4_FoxL2_2.profile_scores",
  "assemblyNames": [
    "Nvec_vc1.1"
  ],
  "adapter": {
    "type": "QuantitativeSequenceAdapter",
    "wiggleAdapter": {
      "type": "BigWigAdapter",
      "bigWigLocation": {
        "uri": "bias_neuron_Pou4_FoxL2_2.profile_scores.bw",
        "locationType": "UriLocation",
        "baseUri": "https://sebelab.crg.eu/Nvec-vc1.1-jb2/config.json"
      }
    },
    "sequenceAdapter": {
      "type": "IndexedFastaAdapter",
      "fastaLocation": {
        "uri": "Nvec_vc1.1_gDNA_mtDNA.fasta",
        "locationType": "UriLocation",
        "baseUri": "https://sebelab.crg.eu/Nvec-vc1.1-jb2/config.json"
      },
      "faiLocation": {
        "uri": "Nvec_vc1.1_gDNA_mtDNA.fasta.fai",
        "locationType": "UriLocation",
        "baseUri": "https://sebelab.crg.eu/Nvec-vc1.1-jb2/config.json"
      }
    }
  },
  "displays": [
    {
      "displayId": "QuantitativeSequence_display",
      "type": "QuantitativeSequenceDisplay"
    }
  ]
}

Also, is the pull request #3 integrated by now? It would be great if this was available, too. If the letters there were less spaced apart, it would both look nicer and help to use this visualization over the broader interval.

Thank you so much for all your amazing work!

cmdcolin commented 4 months ago

It's possible that with this error, that you may not have the plugin installed (?)

You mention something here "Firstly, I had to put plugins block inside the configuration block (as opposed to the top-most level in the config file, as I understood from the documentation)."

can you paste the entire config perhaps including plugin block?

cmdcolin commented 4 months ago

Also, is the pull request https://github.com/GMOD/jbrowse-plugin-quantseq/pull/3 integrated by now? It would be great if this was available, too. If the letters there were less spaced apart, it would both look nicer and help to use this visualization over the broader interval.

this PR isn't merged yet but could be considered also! it does need a little work to make it look good. right now the PR just uses the colored bar to indicate color

anamariaelek commented 4 months ago

Thanks for your (as always) very prompt reply Colin.

I am running Jbrowse from Docker on a web server, so I assumed it should be available. Sorry for my ignorance if I am missing something obvious, I haven't used any plugins before.

Here are the relevant bits of config file (the whole file here is huge).

{
  "assemblies": [
    {
      "name": "Nvec_vc1.1",
      "sequence": {
        "type": "ReferenceSequenceTrack",
        "trackId": "Nvec_vc1.1-ReferenceSequenceTrack",
        "adapter": {
          "type": "IndexedFastaAdapter",
          "fastaLocation": {
            "uri": "Nvec_vc1.1_gDNA_mtDNA.fasta",
            "locationType": "UriLocation"
          },
          "faiLocation": {
            "uri": "Nvec_vc1.1_gDNA_mtDNA.fasta.fai",
            "locationType": "UriLocation"
          }
        }
      }
    }
  ],
  "configuration": {
    "hierarchical": {
      "sort": {
        "trackNames": true,
        "categories": true
      },
      "defaultCollapsed": {
        "topLevelCategories": true
      }
    },
    "plugins": [
      {
        "name": "Quantseq",
        "url": "https://unpkg.com/jbrowse-plugin-quantseq/dist/jbrowse-plugin-seq.umd.production.min.js"
      }
    ],
    "logoPath": {
      "uri": "nvec-logo.svg"
    }
  },
  "connections": [],
  "defaultSession": {

      ...

  },
  "tracks": [
    {

      ...

      {
        "type": "QuantitativeTrack",
        "trackId": "bias_neuron_Pou4_FoxL2_2.profile_scores.bw",
        "name": "bias_neuron_Pou4_FoxL2_2.profile_scores",
        "assemblyNames": [
          "Nvec_vc1.1"
        ],
        "adapter": {
          "type": "QuantitativeSequenceAdapter",
          "wiggleAdapter": {
            "type": "BigWigAdapter",
            "bigWigLocation": {
              "uri": "bias_neuron_Pou4_FoxL2_2.profile_scores.bw",
              "locationType": "UriLocation"
            }
          },
          "sequenceAdapter": {
            "type": "IndexedFastaAdapter",
            "fastaLocation": {
              "uri": "Nvec_vc1.1_gDNA_mtDNA.fasta",
              "locationType": "UriLocation"
            },
            "faiLocation": {
              "uri": "Nvec_vc1.1_gDNA_mtDNA.fasta.fai",
              "locationType": "UriLocation"
            }
          }
        },
        "displays": [
          {
            "displayId": "QuantitativeSequence_display",
            "type": "QuantitativeSequenceDisplay"
          }
        ]
      }
    }
  ],
  "aggregateTextSearchAdapters": [
    {
      "type": "TrixTextSearchAdapter",
      "textSearchAdapterId": "Nvec_vc1.1-index",
      "ixFilePath": {
        "uri": "trix/Nvec_vc1.1.ix",
        "locationType": "UriLocation"
      },
      "ixxFilePath": {
        "uri": "trix/Nvec_vc1.1.ixx",
        "locationType": "UriLocation"
      },
      "metaFilePath": {
        "uri": "trix/Nvec_vc1.1_meta.json",
        "locationType": "UriLocation"
      },
      "assemblyNames": [
        "Nvec_vc1.1"
      ]
    }
  ]
}
cmdcolin commented 4 months ago

i think this should work, i just moved plugins section out of configuration subkey to the "top level" of the config json

{
    "plugins": [
      {
        "name": "Quantseq",
        "url": "https://unpkg.com/jbrowse-plugin-quantseq/dist/jbrowse-plugin-quantseq.umd.production.min.js"
      }
    ],
  "assemblies": [
    {
      "name": "Nvec_vc1.1",
      "sequence": {
        "type": "ReferenceSequenceTrack",
        "trackId": "Nvec_vc1.1-ReferenceSequenceTrack",
        "adapter": {
          "type": "IndexedFastaAdapter",
          "fastaLocation": {
            "uri": "Nvec_vc1.1_gDNA_mtDNA.fasta",
            "locationType": "UriLocation"
          },
          "faiLocation": {
            "uri": "Nvec_vc1.1_gDNA_mtDNA.fasta.fai",
            "locationType": "UriLocation"
          }
        }
      }
    }
  ],
  "configuration": {
    "hierarchical": {
      "sort": {
        "trackNames": true,
        "categories": true
      },
      "defaultCollapsed": {
        "topLevelCategories": true
      }
    },

    "logoPath": {
      "uri": "nvec-logo.svg"
    }
  },
  "connections": [],
  "defaultSession": {

      ...

  },
  "tracks": [
    {

      ...

      {
        "type": "QuantitativeTrack",
        "trackId": "bias_neuron_Pou4_FoxL2_2.profile_scores.bw",
        "name": "bias_neuron_Pou4_FoxL2_2.profile_scores",
        "assemblyNames": [
          "Nvec_vc1.1"
        ],
        "adapter": {
          "type": "QuantitativeSequenceAdapter",
          "wiggleAdapter": {
            "type": "BigWigAdapter",
            "bigWigLocation": {
              "uri": "bias_neuron_Pou4_FoxL2_2.profile_scores.bw",
              "locationType": "UriLocation"
            }
          },
          "sequenceAdapter": {
            "type": "IndexedFastaAdapter",
            "fastaLocation": {
              "uri": "Nvec_vc1.1_gDNA_mtDNA.fasta",
              "locationType": "UriLocation"
            },
            "faiLocation": {
              "uri": "Nvec_vc1.1_gDNA_mtDNA.fasta.fai",
              "locationType": "UriLocation"
            }
          }
        },
        "displays": [
          {
            "displayId": "QuantitativeSequence_display",
            "type": "QuantitativeSequenceDisplay"
          }
        ]
      }
    }
  ],
  "aggregateTextSearchAdapters": [
    {
      "type": "TrixTextSearchAdapter",
      "textSearchAdapterId": "Nvec_vc1.1-index",
      "ixFilePath": {
        "uri": "trix/Nvec_vc1.1.ix",
        "locationType": "UriLocation"
      },
      "ixxFilePath": {
        "uri": "trix/Nvec_vc1.1.ixx",
        "locationType": "UriLocation"
      },
      "metaFilePath": {
        "uri": "trix/Nvec_vc1.1_meta.json",
        "locationType": "UriLocation"
      },
      "assemblyNames": [
        "Nvec_vc1.1"
      ]
    }
  ]
}
anamariaelek commented 4 months ago

This works!

I tried specifying plugins there in the first place, but it's actually the url from the README which was not correct: https://unpkg.com/jbrowse-plugin-quantseq/dist/jbrowse-plugin-seq.umd.production.min.js -> incorrect https://unpkg.com/jbrowse-plugin-quantseq/dist/jbrowse-plugin-quantseq.umd.production.min.js -> works

Thank you so much for the help with this!

cmdcolin commented 4 months ago

awesome...updated the README now :)