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 | |
| # Setup arrays to store train and test accuracies | |
| neighbors = np.arange(1, 9) | |
| train_accuracy = np.empty(len(neighbors)) | |
| test_accuracy = np.empty(len(neighbors)) | |
| # Loop over different values of k | |
| for i, k in enumerate(neighbors): | |
| # Setup a k-NN Classifier with k neighbors: knn |
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
| # Download Kallisto and sratools (the latter to be able to download from SRA) | |
| wget https://github.com/pachterlab/kallisto/releases/download/v0.42.3/kallisto_mac-v0.42.3.tar.gz | |
| tar zvxf kallisto_mac-v0.42.3.tar.gz | |
| wget http://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/2.5.2/sratoolkit.2.5.2-mac64.tar.gz | |
| tar zxvf sratoolkit.2.5.2-mac64.tar.gz | |
| # Download and merge human cDNA and ncDNA files from Ensembl for the index. | |
| wget ftp://ftp.ensembl.org/pub/current_fasta/homo_sapiens/cdna/Homo_sapiens.GRCh38.cdna.all.fa.gz | |
| wget ftp://ftp.ensembl.org/pub/current_fasta/homo_sapiens/ncrna/Homo_sapiens.GRCh38.ncrna.fa.gz | |
| cat Homo_sapiens.GRCh38.cdna.all.fa.gz Homo_sapiens.GRCh38.ncrna.fa.gz > Homo_sapiens.GRCh38.rna.fa.gz |
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
| %%writefile make_conda_env.sh | |
| #!/usr/bin/env bash | |
| # author: github.com/ruxi | |
| # reproducibly create conda env | |
| read -p "Create new conda env (y/n)?" CONT | |
| if [ "$CONT" == "n" ]; then | |
| echo "exit"; | |
| else |
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
| %%writefile make_conda_env.sh | |
| #!/usr/bin/env bash | |
| # author: github.com/ruxi | |
| # reproducibly create conda env | |
| read -p "Create new conda env (y/n)?" CONT | |
| if [ "$CONT" == "n" ]; then | |
| echo "exit"; | |
| else |