Coder Social home page Coder Social logo

extract-sequence-lengths's Introduction

extract-sequence-lengths

Extract sequence lengths from a fasta file and save them to a tab-delimited text file in genome file format.

This script uses Biopython to calculate the lengths of sequences stored in a fasta file and then outputs those lengths to a text file in the format:

chr01 1234567
chr02 9876543
...
chrN  2468101

The output text file is suitable as input into other commands, including bedtools.

USAGE

The syntax of this script is as follows:

python3 extract_sequence_lengths.py <NAME OF FASTA FILE> <NAME YOU WANT FOR OUTPUT FILE>

For example this code:

python3 extract_sequence_lengths.py example_chromosomes.fasta example_chromosome_lengths.txt

will calculate the length of each sequence in example_chromosomes.fasta and save those lengths to the example_chromosome_lengths.txt file.

DEPENDENCIES

  1. Biopython - Installation instructions here. Usually you just type:

pip install biopython

  1. The sys python module, which usually ships with python installations.

extract-sequence-lengths's People

Contributors

milesroberts-123 avatar

Watchers

 avatar

Forkers

xiangrong131

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.