Git Product home page Git Product logo

cbio_py's People

Contributors

lucas-gomes-s avatar odagayev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

lucas-gomes-s

cbio_py's Issues

HTTPFound: 302 error when trying to import cbio_mod

First GitHub post. Here we go.

I want to extract data from the cBioPortal for a project using Python. Following these instructions, I installed cbio_py using the pip installer. However, when I try the second command, from cbio_py import cbio_mod as cb, I get an HTTPFound: 302 message.

I've tried this in the terminal and in Jupyter Notebook run from Anaconda and on two different laptops and get the same result. Here's the full text of the error in Jupyter.

HTTPFound                                 Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 from cbio_py import cbio_mod as cb

File ~/opt/anaconda3/lib/python3.9/site-packages/cbio_py/cbio_mod.py:4, in <module>
      1 from bravado.client import SwaggerClient as bravado_client
      3 # This is the initialization of many of the data sources that we will need
----> 4 cbioportal = bravado_client.from_url('https://www.cbioportal.org/api/api-docs', 
      5     config={"validate_requests":False,"validate_responses":False,"validate_swagger_spec": False,})
      7 #Fetch all of the studies
      8 def getAllStudies(return_type = 'dict'): #I assume the end user will prefer a dictionary object

File ~/opt/anaconda3/lib/python3.9/site-packages/bravado/client.py:98, in SwaggerClient.from_url(cls, spec_url, http_client, request_headers, config)
     96 http_client = http_client or RequestsClient()
     97 loader = Loader(http_client, request_headers=request_headers)
---> 98 spec_dict = loader.load_spec(spec_url)
    100 # RefResolver may have to download additional json files (remote refs)
    101 # via http. Wrap http_client's request() so that request headers are
    102 # passed along with the request transparently. Yeah, this is not ideal,
    103 # but since RefResolver has new found responsibilities, it is
    104 # functional.
    105 if request_headers is not None:

File ~/opt/anaconda3/lib/python3.9/site-packages/bravado/swagger_model.py:101, in Loader.load_spec(self, spec_url, base_url)
     94 def load_spec(self, spec_url, base_url=None):
     95     """Load a Swagger Spec from the given URL
     96 
     97     :param spec_url: URL to swagger.json
     98     :param base_url: TODO: need this?
     99     :returns: json spec in dict form
    100     """
--> 101     response = request(
    102         self.http_client,
    103         spec_url,
    104         self.request_headers,
    105     ).result()
    107     content_type = response.headers.get('content-type', '').lower()
    108     if is_yaml(spec_url, content_type):

File ~/opt/anaconda3/lib/python3.9/site-packages/bravado/http_future.py:282, in HttpFuture.result(self, timeout)
    279 if 200 <= incoming_response.status_code < 300:
    280     return incoming_response
--> 282 raise make_http_exception(response=incoming_response)

HTTPFound: 302 

Any advice on solving this? Thanks.

Accessing gene expression data via the package

Hi,

is it possible to access RNAseq data (a table of gene expression values) via the package?

So far I came only to this:

cb.getMolecularProfile("laml_tcga_rna_seq_v2_mrna")

However it just returns:

{'datatype': 'CONTINUOUS', 'description': 'mRNA gene expression (RNA Seq V2 RSEM)', 'genericAssayType': None, 'molecularAlterationType': 'MRNA_EXPRESSION', 'molecularProfileId': 'laml_tcga_rna_seq_v2_mrna', 'name': 'mRNA expression (RNA Seq V2 RSEM)', 'patientLevel': False, 'pivotThreshold': None, 'showProfileInAnalysisTab': False, 'sortOrder': None, 'study': CancerStudy(allSampleCount=None, cancerType=None, cancerTypeId='aml', citation=None, cnaSampleCount=None, completeSampleCount=None, description='TCGA Acute Myeloid Leukemia. Source data from <A HREF="http://gdac.broadinstitute.org/runs/stddata__2016_01_28/data/LAML/20160128/">GDAC Firehose</A>. Previously known as TCGA Provisional.', groups='PUBLIC', importDate='2023-06-19 09:43:19', massSpectrometrySampleCount=None, methylationHm27SampleCount=None, miRnaSampleCount=None, mrnaMicroarraySampleCount=None, mrnaRnaSeqSampleCount=None, mrnaRnaSeqV2SampleCount=None, name='Acute Myeloid Leukemia (TCGA, Firehose Legacy)', pmid=None, publicStudy=True, readPermission=True, referenceGenome='hg19', rppaSampleCount=None, sequencedSampleCount=None, status=0, studyId='laml_tcga', treatmentCount=None), 'studyId': 'laml_tcga'}

Thanks for the response,

K.

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.