pepkit / pepdbagent

Database for storing sample metadata
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

`get_projects` should accept a namespace parameter #12

Closed nleroy917 closed 1 year ago

nleroy917 commented 1 year ago

It would be nice to be able to pass a namespace parameter to the get_projects method of PepAgent. This way I don't have to manually filter out namespaces that are not relevant when pulling them down and it saves on network latency.

Something like this:

projects = db.get_projects("geo")
nleroy917 commented 1 year ago

Maybe this can be two things:

  1. Just the project names, or
  2. Full objects

Option 1:

>>> projects = db.get_projects("geo")
>>> projects
>>> ['GSE123456', 'GSE987654', ... ]

Option 2:

>>> projects = db.get_projects("geo", names_only=False)
>>> projects
>>> [ 
    'GSE12345': peppy.Project( ... ),
    'GSE98765': peppy.Project( ... )
]
khoroshevskyi commented 1 year ago

Added!