Giter VIP home page Giter VIP logo

bio362---bioinformatics-labs's Introduction

BIO362---Bioinformatics-Labs

#Bioinformatics Labs Python Code

#GWAS dataset and Pandas DataFrame

import pandas as pd

my_gwas = pd.read_table('gwas_data.txt')

gwas_columns = my_gwas.columns

print(my_gwas.head()) print(my_gwas.shape) print(gwas_columns)

import pandas as pd

gwas_2 = pd.read_table('gwas_data.txt') print(gwas_2.head())

base_comp_df = gwas_2[['CHR', 'BP', 'BASE']]

print(base_comp_df.head())

gwas_data = pd.read_table('gwas_data.txt')

gwas_data_fixed = gwas_data.assign(log_p = -(numpy.log10(gwas_data.P)))

print(gwas_data_fixed.head())

candidate_snps = gwas_data_fixed[gwas_data_fixed.log_p >= 5]

candidate_snp_count = candidate_snps.shape

print(candidate_snps) print(candidate_snp_count)

import pandas as pd

def p_hist(gwas_df, num_bins: int): return gwas_df.P.hist(bins = num_bins)

p_hist(gwas_data, 200)

import pandas as pd

def manhattan(gwas_df, chromosome): '''Pre-condition: chromosome in gwas_df.CHR ''' my_df = gwas_df[gwas_df.CHR == chromosome] my_df2 = my_df.assign(log_p = -(numpy.log10(my_df.P)))

my_plot = my_df2.plot(x = 'BP', y = 'log_p', kind = 'scatter')

return my_plot

manhattan(gwas_data, 3)

bio362---bioinformatics-labs's People

Contributors

hammadtheone avatar

Stargazers

 avatar

Watchers

 avatar

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.