Skip to content

Instantly share code, notes, and snippets.

View rmadupuri's full-sized avatar
🎯
Focusing

Ramya Madupuri rmadupuri

🎯
Focusing
  • Memorial Sloan Kettering Cancer Center
  • New York, NY
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#Script to integrate TBL scores to Pancan, CCLE, PACAWG clinical_sample files
import os
import pandas as pd
dh_path = "/Users/madupurr/Github/datahub/public"
tbl_scores_path = "/Users/madupurr/Desktop/TBL_scores/TBL_scores.txt"
tbl_scores = pd.read_csv(tbl_scores_path ,sep='\t',header = None)
import sys
import os
study_dir = "/Users/madupurr/Desktop/genie_subset/impact_subset"
output_dir = "/Users/madupurr/Desktop/genie_subset/corrected_ids"
files = os.listdir(study_dir)
def extract_header(study_dir, filename):
with open(study_dir+'/'+filename, 'r') as infile:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rmadupuri
rmadupuri / htan_crc_merge_2_h5ad_files_generate_absolute_relative_freq_bulk_rna_counts.ipynb
Created October 5, 2023 12:16
# This script merges two h5ad files and generates # 1. The absolute and relative cell frequencies # 2. Pseudo bulk RNA counts per samples averaged across the cells.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/python
import sys
import os
import optparse
# Script to remove duplicate maf records based on the 8 key columns.
# Calculates VAF for each record and picks the record with high VAF
# Formula for VAF = t_alt_count / (t_ref_count + t_alt_count)
ERROR_FILE = sys.stderr
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rmadupuri
rmadupuri / convert_3d_matrix.py
Last active September 13, 2023 18:25
Convert tabular data to a 3D matrix
"""Convert data in
python code to convert
P-0000246-T05 LTB 2
P-0000246-T05 NOTCH4 2
P-0002556-T03 KMT2A 2
P-0003309-T02 ATM -2
to
Gene P-0000246-T05 P-0002556-T03 P-0003309-T02