Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does anyone know the method of Moleculo's Long DNA Fragment Sequence? silin284 Illumina/Solexa 31 02-27-2015 08:09 AM
The same sequence occurs multiple times in blastp output bioagri Bioinformatics 1 03-19-2012 01:28 AM
GEO sequence count johnsequence Bioinformatics 0 05-12-2011 08:15 AM
Find long indel from captured gene sequence tzuseq Introductions 0 03-15-2011 04:08 PM
Repeating a SOLiD Focal Map pmiguel SOLiD 2 09-09-2010 04:34 AM

Thread Tools
Old 02-05-2013, 07:15 AM   #1
Location: asia

Join Date: Jul 2012
Posts: 38
Default How to count the repeating times of a certain 11bp long sequence

Hi, all
I want to count the repeating times of an 11bp long sequence(for example: tcgtgacggta ) in human and mouse genome. Further I need know the positions of this sequence located in. This 11bp sequence is a potential motif . First I need know how many copies of this sequence in human and moue genomes. And then to know where they are.

Is there any tool for this?

Thanks .
HSV-1 is offline   Reply With Quote
Old 02-05-2013, 07:45 AM   #2
Location: Berlin

Join Date: Oct 2010
Posts: 71

Hi HSV-1,

You can use bowtie with option -c TCGTGACGGTA
and specify that you want to output all alignments via option -a.
However, in this case you also need to specify that only perfect matches are allowed via -v 0.

See for more details.


Last edited by rboettcher; 02-05-2013 at 07:48 AM.
rboettcher is offline   Reply With Quote
Old 02-05-2013, 11:18 AM   #3
Richard Finney
Senior Member
Location: bethesda

Join Date: Feb 2009
Posts: 700

Here's a fast C solution ... output is 0 based (so add one).

This takes about 2 minutes on my 2000 bogomips machine for hg19 ...

______ begin code _______
// this program finds short patterns and reverse complemented patterns in *.fa fasta (genome) files
// how to compile: gcc -Wall -O3 -o patmatch patmach.c
// how to use : for i in *.fa; do cat $i | ./patmatch; done

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>

// put your pattern in pat1 and the reverse complement in pat2 ...
char pat1[] = "TCGTGACGGTA"; // use upper case - NB: this should be a parameter but you can do it
char pat2[] = "TACCGTCACGA"; // reverse complement of pat1

#define MAXCHROMSIZE 254235640 // maximum chromsome size - edit as necessary - you will need to fix this IF you're using a whole genome FASTA
char chr[MAXCHROMSIZE + 50];

int main()
long int i,len;
int j;
char header[5012];
char s[5012];
char *spot = &chr[0];

while (gets(s))
if (s[0] == '>') { strcpy (header,s); continue;}
for (i=0;s[i];i++) s[i] = toupper(s[i]);
for ( ; *spot ; spot++) ;
len = spot-chr;
spot = chr;
for (i=0;i<len;i++)
if (chr[i] == (char)0) break;
for (j=0;pat1[j]==chr[i+j];j++);
if (j == 11) printf("F %s at %ld\n",header,i);
for (j=0;pat2[j]==chr[i+j];j++);
if (j == 11) printf("R %s at %ld\n",header,i);
return 0;

_______ end code ______

Example for hg19 fastas ...

-bash-3.00$ for i in *.fa; do cat $i | ./patmatch; done
R >chr10 at 111870831
F >chr11 at 36061863
R >chr11 at 77190239
R >chr12 at 119747880
R >chr14 at 81206117
R >chr14 at 95419269
R >chr16 at 11844841
F >chr16 at 78553508
R >chr17 at 45266108
F >chr1 at 17428420
F >chr1 at 52442586
F >chr2 at 25065131
R >chr2 at 53867779
R >chr2 at 114616666
F >chr3 at 55121176
F >chr4 at 1412897
R >chr4 at 136465390
R >chr5 at 84661141
R >chr5 at 103058499
F >chr7 at 2875412
R >chr9 at 75467056

Last edited by Richard Finney; 02-05-2013 at 11:28 AM.
Richard Finney is offline   Reply With Quote
Old 02-06-2013, 12:04 AM   #4
Senior Member
Location: Denmark

Join Date: Apr 2009
Posts: 153

This can be done with Biopieces ( like this:

read_fasta -i genome.fna | patscan_seq -p tcgtgacggta | write_bed -o out.bed -x
maasha is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 11:55 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO