Extract Fasta Sequences Sub Sets by position
cut -d " " -f 1 sequences.fa | tr -s "\n" "\t"| sed -s 's/>/\n/g' > sequences.tab
while read id start end; do \
g=$(grep "$id" sequences.tab | cut -f 2 | cut -c $start-$end);\
echo ">$id";\
echo $g;\
done<coordinates.txt
#!/usr/bin/perl -w
use Bio::DB::Fasta;
#Usage: extract_substring.pl file.fasta coordinates.txt (where: id, start, stop) > out.fasta
my $fasta = $ARGV[0];
my $query = $ARGV[1];
my ($id,$start,$stop);
my $db = Bio::DB::Fasta -> new($fasta); # Create database from a directory of Fasta files
# my $db = Bio::DB::Fasta->new('/path/to/fasta/files/');
open (IN1, $query);
while (<IN1>) {
($id,$start,$stop) = split "\t";
my $subseq = $db->subseq($id,$start,$stop);
print ">", $id, "_", $start, "_", $stop;
print $subseq, "\n";
}
close IN1;
Extract Fasta Sequences Sub Sets by position的更多相关文章
- 根据位置信息提取 fasta 文件中的序列 -- extract fasta sequence by their position
#!/usr/bin/env python # usages: python extract_seq_by_pos.py input.fasta id_start_end > result.fa ...
- Lua 5.1 参考手册
Lua 5.1 参考手册 by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes 云风 译 www.codingno ...
- Getting started with new I/O (NIO)--reference
The new input/output (NIO) library, introduced with JDK 1.4, provides high-speed, block-oriented I/O ...
- NGS中的一些软件功能介绍
1.bowtie 短序列比对工具,blast也是短序列比对工具,速度快,结果易理解. 输入可以是fastq或者fasta文件. 生成比对结果文件sam格式的吧. 2.bwa 转自:https://ww ...
- T-SQL Recipes之Separating elements
Separating elements Separating elements is a classic T-SQL challenge. It involves a table called Arr ...
- CSharpGL(4)设计和使用Camera
CSharpGL(4)设计和使用Camera +BIT祝威+悄悄在此留下版了个权的信息说: 主要内容 描述在OpenGL中Camera的概念和用处. 设计一个Camera以及操控Camera的Sate ...
- Microsoft Win32 to Microsoft .NET Framework API Map
Microsoft Win32 to Microsoft .NET Framework API Map .NET Development (General) Technical Articles ...
- Digests from CG articales
Turtle Talk Prior to the on-set motion capture, the team had the actors perform expressions while be ...
- jQuery String Functions
In today's post, I have put together all jQuery String Functions. Well, I should say that these are ...
随机推荐
- 持久化存储——偏好设置,plist,归档---学习笔记二
//一. 本地持久化 //1.沙盒 //1.1 应用程序包:存放的是应用程序的源文件,包括资源文件和可执行文件 NSString *path = [[NSBundle mainBundle]bundl ...
- MMDrawerController的使用
1.http://www.jianshu.com/p/9e55cbf7d5ab MMDrawerController的使用
- UIButton(改变Title和image位置)
UIButton *btn = [[UIButton alloc] init]; [btn setFrame:frame]; [btn setTitleColor:titleColor forStat ...
- C语言操作内存
炒了个栗子 #include <stdio.h> #define N1 (5) #define N2 (7) #define N3 (3) int main(){ int *ip; int ...
- AAL模版 中英文对照
来源:http://52brain.com/thread-17336-1-1.html Brodmann分区是一个根据细胞结构将大脑皮层划分为一系列解剖区域的系统.神经解剖学中所谓细胞结构(Cytoa ...
- MySQL数据库的优化(下)MySQL数据库的高可用架构方案
MySQL数据库的优化(下)MySQL数据库的高可用架构方案 2011-03-09 08:53 抚琴煮酒 51CTO 字号:T | T 在上一篇MySQL数据库的优化中,我们跟随笔者学习了单机MySQ ...
- 跟我学习Storm_Storm主要特点
Storm拥有低延迟.高性能.分布式.可扩展.容错等特性,可以保证消息不丢失,消息处理严格有序.Storm的主要特点如下所示: 简单的编程模型.类似于MapReduce降低了并行批处理复杂性,Stor ...
- Theano2.1.18-基础知识之theano的扩展
来自:http://deeplearning.net/software/theano/tutorial/extending_theano.html Extending Theano 该教程覆盖了如何使 ...
- 【跟着子迟品underscore】从用 `void 0` 代替 `undefined` 说起
Why underscore 最近开始看 underscore源码,并将 underscore源码解读 放在了我的 2016计划 中. 阅读一些著名框架类库的源码,就好像和一个个大师对话,你会学到很多 ...
- ASP.NET网站入侵第三波(fineui系统漏洞,可导致被拖库)
注:屏蔽本漏洞的紧急通知:http://fineui.com/bbs/forum.php?mod=viewthread&tid=7863 本人小学文化,文采不好,写的不好请各位多多包含, 最近 ...