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 ...
随机推荐
- Android开发书籍推荐:从入门到精通系列学习路线书籍介绍
Android开发书籍推荐:从入门到精通系列学习路线书籍介绍 很多时候我们都会不断收到新手的提问"Android开发的经典入门教材和学习路线?"."Android 开发入 ...
- 程序员级别鉴定书(.NET面试问答集锦)
作为一个.NET程序员,应该知道的不仅仅是拖拽一个控件到设计时窗口中.就像一个赛车手,一定要了解他的爱车 – 能做什么不能做什么. 本文参考Scott Hanselman给出的.NET问题列表,整理如 ...
- APIO2013 tasksauthor
喜闻乐见的提答题,这道题还是蛮有趣的 数据结构题写得心塞,来一道提答意思意思 如果喜欢这类题的话还可以去做做uoj83. 这题是给出了两个问题,一个最短路,一个无向图染色问题. Data 1 Floy ...
- gedit脚本
明天ctsc,赶紧学了一下gedit的配置 以下假设你只在/home/zzq下写代码(用户名自己改) 首先在/home/zzq下建一个runner.sh,内容如下: #!/bin/bash echo ...
- swift基本用法-数组array
数组简单用法 //------------------------------------------------------------------------------ // 1. 数组定义 / ...
- JavaScript的闭包和内存泄漏问题
闭包 http://www.ruanyifeng.com/blog/2009/08/learning_javascript_closures.html JavaScript中必须提到的功能最强大的抽象 ...
- Nodejs生态圈的TypeScript+React
基于Nodejs生态圈的TypeScript+React开发入门教程 基于Nodejs生态圈的TypeScript+React开发入门教程 概述 本教程旨在为基于Nodejs npm生态圈的前端程 ...
- 2013级软件工程GitHub账号信息
GitHub账号信息 序号 班级 学号 姓名 个人GitHub网址 1 信1301-1班 20122951 刘伟 https://github.com/weige8882 2 信1301-1班 201 ...
- realmswift的使用
官网:https://realm.io/ 1.说下数据库迁移的问题: 在func application(application: UIApplication, didFinishLaunchingW ...
- Openwrt dnsmasq 设置要点
之前设置dnsmasq,一直没有奏效,后来摸索了一下,初步发现它的原理: 正常的流程应该是像这样的,先由client来发送DNS请求到网关,然后网关的dnsmasq处理这个请求, 再根据设置决定如何处 ...