Skip to content

Instantly share code, notes, and snippets.

View ag1805x's full-sized avatar
😎

Arindam Ghosh ag1805x

😎
View GitHub Profile
# Extract gene lengths from GTF file
# Download GTF file from https://gdc.cancer.gov/about-data/gdc-data-processing/gdc-reference-files
echo "Gene_ID, Gene_name, Gene_type, Chr, Start, End, Gene_length" > gdc_gencode_v36_annotation.csv
awk '{if($3 == "gene") print $0}' gencode.v36.annotation.gtf | awk -F '[\t ;]' '{print $10","$16","$13","$1","$4","$5","$5-$4}' >> gdc_gencode_v36_annotation.csv
@ag1805x
ag1805x / Focal_loss_parameter_impact.py
Last active July 11, 2025 06:02
Code to see how focal loss changes as alpha and gamma are changed.
# Code to see how focal loss changes as alpha and gamma are changed.
# Load libraries
import torch
import torch.nn.functional as F
# Define data to calculate focal loss
# includes two correct predictions and two incorrect predictions