Giter VIP home page Giter VIP logo

q2-coordinates's People

Contributors

adamovanja avatar antgonza avatar gregcaporaso avatar lenafloerl avatar misialq avatar nbokulich avatar zoechallacombe avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

q2-coordinates's Issues

Interactive map is sometimes missing

Steps to reproduce:

  • use the attached metadata file to draw an interactive map as follows:
    qiime coordinates draw-interactive-map \ 
       --m-metadata-file meta_sample.txt \           
       --p-latitude Latitude \
       --p-longitude Longitude \
       --p-column Depth \            
       --o-visualization test-viz.qzv 
    
  • open the visualization

Expected behaviour:
Map is displayed correctly.

Actual behaviour:
Map is missing - see the screenshot.
Screen Shot 2022-01-25 at 13 33 26

adjust map size

they should be larger, and dimensions should be fixed, or at least fixed height? Currently fixed width (I think), which results in lots of white space if maps are longer than wide.

Do quadtrees need a new transformer?

This is a followup question/issue related to #10

I note that the quadtree is output as a Phylogeny[Rooted], but the README shows some provenance-breaking reformatting necessary to use with q2-empress. Is a new transformer needed? Or why is this reformatting not just done in the first place?

If reformatting is necessary for this to be used as a normal Phylogeny[Rooted], then a quadtree should have its own special type (maybe Phylogeny[quadtree]), and we can add a transformer or an action to perform this conversion.

Any thoughts @zoechallacombe @wasade ? Thanks!

add distance scale to maps

automatically adjust scale to sensible unit, size, and intervals (e.g., 1 km intervals)

automatically locate to unused corner or outside of plot beneath legend.

update installation instructions

they point to nbokulich/q2-coordinates instead of bokulich-lab/q2-coordinates

also the dependencies, etc might need updating.

BUG: `draw-*map`: `column` should be optional

column should be optional in draw-interactive-map and draw-map, i.e., if no column is selected, all points should be colored uniformly. Currently, it is optional but omitting a column raises an error:

Test data: metadata.txt

Command:

qiime coordinates draw-interactive-map \
    --m-metadata-file metadata.txt \
    --p-latitude lat \
    --p-longitude lon \
    --o-visualization map.qzv

Full traceback:

Traceback (most recent call last):
  File "/Users/nbokulich/miniconda3/envs/q2coord/lib/python3.6/site-packages/q2cli/commands.py", line 329, in __call__
    results = action(**arguments)
  File "/Users/nbokulich/miniconda3/envs/q2coord/lib/python3.6/site-packages/decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
  File "/Users/nbokulich/miniconda3/envs/q2coord/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
    output_types, provenance)
  File "/Users/nbokulich/miniconda3/envs/q2coord/lib/python3.6/site-packages/qiime2/sdk/action.py", line 452, in _callable_executor_
    ret_val = self._callable(output_dir=temp_dir, **view_args)
  File "/Users/nbokulich/miniconda3/envs/q2coord/lib/python3.6/site-packages/q2_coordinates/mapper.py", line 129, in draw_interactive_map
    ['column', 'latitude', 'longitude'], missing_data)
  File "/Users/nbokulich/miniconda3/envs/q2coord/lib/python3.6/site-packages/q2_coordinates/_utilities.py", line 27, in _load_and_validate
    metadata = metadata[columns]
  File "/Users/nbokulich/miniconda3/envs/q2coord/lib/python3.6/site-packages/pandas/core/frame.py", line 2912, in __getitem__
    indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1]
  File "/Users/nbokulich/miniconda3/envs/q2coord/lib/python3.6/site-packages/pandas/core/indexing.py", line 1254, in _get_listlike_indexer
    self._validate_read_indexer(keyarr, indexer, axis, raise_missing=raise_missing)
  File "/Users/nbokulich/miniconda3/envs/q2coord/lib/python3.6/site-packages/pandas/core/indexing.py", line 1304, in _validate_read_indexer
    raise KeyError(f"{not_found} not in index")
KeyError: '[None] not in index'

However, selecting a column causes this to work. E.g., command:

qiime coordinates draw-interactive-map \
    --m-metadata-file metadata.txt \
    --p-latitude lat \
    --p-longitude lon \
    --p-column language \
    --o-visualization map.qzv

Looks like draw-map raises the same error as draw-interactive-map so column is not being handled appropriately by either...

refactor readme

The readme is quite outdated. Should be updated to:

  1. patch up the text and visuals
  2. include links to view/download example data/qzvs
  3. some methods need a little more description (or links to better description), e.g., for quadtrees.

choropleth maps

Choropleth maps would be a useful feature, e.g., for plotting average values within a region, or even density of sampling within a region.

input: metadata
required params: latitude, longitude
output: interactive chloropleth map

optional inputs: metadata column to average per area [otherwise plot density by default]

Some examples and relevant projects:
https://plotly.com/python/choropleth-maps/
https://github.com/pysal/mapclassify
https://geopandas.org/en/stable/community/ecosystem.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.