This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# general scatter plot | |
sns.scatterplot(data=ag1_df, x="ivaf", y="ovaf") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Click on file in the repo | |
2) Click on the icon: 'Copy raw contents' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pdb | |
all_ids = set() | |
def parse_ids(ifile: str): | |
"""Parse ids from list. Ids are in first column""" | |
info_d = dict() | |
with open(ifile) as ifile1: | |
for line in ifile1: | |
line = line.rstrip("\n"); | |
if line.startswith("#"): continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from matplotlib_venn import venn2 | |
# Use the venn2 function | |
venn2(subsets = (10, 5, 2), set_labels = ('Group A', 'Group B')) | |
plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Good post at: | |
https://www.biostars.org/p/84686/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// params defaults | |
params.help = false | |
params.cpus = 1 | |
params.C = 'true' | |
def helpMessage() { | |
log.info""" | |
Pipeline to align FASTQ file/s to a reference file | |
-------------------------------------------------- | |
Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extracted from : https://medium.com/analytics-vidhya/pandas-how-to-change-value-based-on-condition-fc8ee38ba529 | |
import pandas as pd | |
import numpy as np | |
data = {'Stock': ['AAPL', 'IBM', 'MSFT', 'WMT'], | |
'Price': [144.8, 141.61, 304.21, 139.5], | |
'PE': [25, 21, 39, 16], | |
'TradingExchange': ['NASDAQ', 'NYSE', 'NASDAQ', 'NYSE']} | |
df = pd.DataFrame(data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# merge | |
bedtools merge -i ifile.bed -c 4 -o collapse # print the merged feature names (4th column) | |
# intersect | |
$ cat A.bed | |
chr1 10 20 | |
chr1 30 40 | |
$ cat B.bed | |
chr1 15 20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nucleus.io import vcf | |
from nucleus.util import variant_utils | |
with vcf.VcfReader('/home/ec2-user/DEEPVARIANT/NA12878_calls.vcf.gz') as reader: | |
print('Sample names in VCF: ', ' '.join(reader.header.sample_names)) | |
for variant in reader: | |
print(variant_utils.variant_type(variant)) # variant type | |
print(variant.reference_name) # reference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import keras | |
import pdb | |
from keras.datasets import mnist | |
from keras.models import Sequential | |
from keras.layers import Dense, Dropout | |
from keras.optimizers import RMSprop | |
import numpy as np | |
# Load mnist data | |
(x_train, y_train), (x_test, y_test) = mnist.load_data() |
NewerOlder