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 ...
随机推荐
- hdu 2586 How far away
How far away ? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) T ...
- JavaScript打开窗口与关闭页面操作大全
JavaScript新开窗口 onClick="javascript:window.location='http://www.sowsoy.com'" JavaScript新开一个 ...
- Samsung I9103刷cm-10.1的方法
按照官方网站的说明一步一步的做下去的时候发现在执行heimdall.exe文件的时候出现“不是win32的应用程序”的错误提示,因此决定按照其它方法安装recovery,然后再刷入CM10.1. sa ...
- C#几个经常用到的字符串截取
C#几个经常用到的字符串截取 一. 1.取字符串的前i个字符 (1)string str1=str.Substring(0,i); (2)string str1=str.Remove(i,str.Le ...
- Html5 Egret游戏开发 成语大挑战(二)干净的eui项目和资源准备
现在我们使用egret来起步开发一个名叫<成语大挑战>的小游戏,关于egret的开发环境就不在这里啰嗦了,直接去官方下载安装就可,egret是我见过开发环境部署最简单的解决方案,这个系列教 ...
- Memcached的安装和使用以及nginx整合memcached
一.模块的安装启动 wget http://cdnetworks-kr-2.d1.sourceforge.net/project/levent/libevent/libevent-2.0/libeve ...
- Python快速教程目录(转)
作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 怎么能快速地掌握Python?这是和朋友闲聊时谈起的问题. Python包含的内容 ...
- 初中级Web开发人员的福音:《JavaScript启示录》上市了
经历过14个月的等待,本书终于上市了,完全口语化叙述,请参考右边的链接. 本书介绍 本书无关于JavaScript设计模式,也无关于JavaScript面向对象代码实现.本书的写作目的也不是鉴别Jav ...
- 韩国网页设计资料《网页设计大师2》JPG+PSD+TXT等 73.89G 百度云下载
< 网页设计大师2 >超越第一代版本,提供更新更精美的网页素材模板.全部由国际顶级设计师精选打造,完全展示走在潮流 之前的设计风格.是网页设计师/UI交互界面设计师必备工具. < 网 ...
- 浅析手机抓包方法实践(zt)
原文:http://drops.wooyun.org/tips/12467 0x00 摘要 在移动逆向分析以及 App 开发的时候,总会需要对其网络行为进行监控测试,本文总结一些抓包思路,并对其使用方 ...