alevax / pyviper

Porting of Protein Activity and Pathway Inference to single cell and Python.
MIT License
4 stars 0 forks source link

Add lab network collection after their publication #71

Open alexanderlewis99 opened 1 month ago

alexanderlewis99 commented 1 month ago

Keep networks stored on GitHub but accessible to the users through the package as follows:

import pandas as pd

def load_csv_from_github(url):
    """
    Load a CSV file from a public GitHub repository.

    Args:
        url (str): The URL of the CSV file on GitHub.

    Returns:
        pandas.DataFrame: The loaded CSV data as a DataFrame.
    """
    try:
        # Read the CSV file from the provided URL
        df = pd.read_csv(url)
        return df
    except Exception as e:
        print("An error occurred:", e)
        return None

# Example usage:
url = "https://raw.githubusercontent.com/username/repository/branch/filename.csv"
data = load_csv_from_github(url)
if data is not None:
    print(data.head())  # Display the first few rows of the loaded data
alexanderlewis99 commented 1 month ago

It would be very convenient for users I think if they could do pyviper.load.p_____(celltype, tissue) and immediately get a tissue-specific celltype network of their choosing