Giter Club home page Giter Club logo

ml-sketching's Introduction

ml-sketching

This is the course project for 02710. The project is about machine learning based sketching algorithms for rna sequence.

Installation

git clone https://github.com/baolef/ml-sketching.git
cd ml-sketching
conda env create -f environment.yml
conda activate sketching

Data

The data we use from SILVA database. You can download the data from here and put it in the inputs/rna/ folder.

In Linux, you can run the following commands to prepare the data:

mkdir -p inputs
cd inputs/rna
wget https://www.arb-silva.de/fileadmin/silva_databases/release_138.1/Exports/SILVA_138.1_SSURef_NR99_tax_silva.fasta.gz
gzip -d SILVA_138.1_SSURef_NR99_tax_silva.fasta.gz

Usage

To train the machine learning based sketching model (rna2vec), you can run the following command to save the model with .w2v extension in the save/ folder:

python scripts/train_dna2vec.py -c configs/rna.yml

To sketch the rna sequence using the rna2vec model, you can run the following command to save the sketching in the inputs/ folder:

python scripts/sketch_rna2vec.py -m MODEL_PATH.w2v -i inputs/SILVA_138.1_SSURef_NR99_tax_silva.fasta -o inputs

To sketch the rna sequence using the MinHash algorithm, you can run the following command to save the sketching in the inputs/ folder:

python scripts/sketch_minhash.py -i inputs/SILVA_138.1_SSURef_NR99_tax_silva.fasta -o inputs

To train the clustering model, you can run the following command:

python scripts/clustering.py -i inputs/SILVA_138_3_8_sliding_0_rna2vec.npz -c 1 -d euclidean
python scripts/clustering.py -i inputs/SILVA_138_3_8_sliding_0_minhash.npz -c 1 -d hamming

Notice that -c is an integer to specify the level of classes in the inheritance tree and -d is a string to specify the distance metric, where we recommend to use euclidean for rna2vec and hamming for MinHash.

To train the classification model, you can run the following command:

python scripts/classification.py -i inputs/SILVA_138_3_8_sliding_0_rna2vec.npz -c 1

Results

rna2vec outperforms MinHash in clustering and classification tasks.

To reproduce the results, you can run the following command after sketching the data:

sh run.sh

ml-sketching's People

Contributors

baolef 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.