Смекни!
smekni.com

Аналіз выкарыстання камп'ютэрў у біяінфарматыцы (стр. 5 из 5)

[5]NCBIEntrez[Электронны рэсурс] . - Рэжым доступу: http://www.ncbi.nlm.nih.gov/Entrez/ . - Дата доступу: 14.01.2009

[6]BLASTN[Электронны рэсурс] . - Рэжым доступу: http://www.ncbi.nlm.nih.gov/Entrez/ . - Дата доступу: 14.01.2009[7]3DSS[Электронны рэсурс] . - Рэжым доступу: http://cluster.physics.iisc.ernet.in/3dss/ . - Дата доступу: 14.01.2009

[8]BioJava[Электронны рэсурс] . - Рэжым доступу: http://biojava.org/ . - Дата доступу: 14.01.2009

[9]IntelliJIdea[Электронны рэсурс] . - Рэжым доступу: http://www.jetbrains.com/idea/ . - Дата доступу: 14.01.2009


ДАДАТАК 1

Лістынг праграмы BioJavaProgram

importorg.biojava.bio.symbol.IllegalSymbolException;

import org.biojava.bio.seq.DNATools;

import org.biojava.bio.seq.Sequence;

import org.biojava.bio.alignment.SubstitutionMatrix;

import org.biojava.bio.alignment.SequenceAlignment;

import org.biojava.bio.alignment.NeedlemanWunsch;

import org.biojava.bio.alignment.SmithWaterman;

import java.io.*;

import java.util.List;

import java.util.ArrayList;

/**

* @author Siarhei Khamenka

*/

public class BioJavaProgram {

public static final String MATRIX_PATH = "/home/kotuk/NUC44.MAT";

public static final String SEQUENCES_PATH = "/home/kotuk/fasta/";

static Sequence getSequence(String fileName) {

try {

BufferedReader br = new BufferedReader(new FileReader(SEQUENCES_PATH + fileName));

String name = br.readLine(), st, seq = "";

while ((st = br.readLine()) != null) {

seq += st;

}

br.close();

return DNATools.createDNASequence(seq, name);

} catch (IOException e) {

e.printStackTrace();

} catch (IllegalSymbolException e) {

e.printStackTrace();

}

return null;

}

static List<Sequence> getBestSeq(SequenceAlignment aligner) throws Exception {

String[] seqFiles = new File(SEQUENCES_PATH).list();

Sequence bestQuery = null, bestTarget = null;

double maxRes = Double.MIN_VALUE;

for (int i = 0; i < seqFiles.length; i++) {

Sequence query = getSequence(seqFiles[i]);

for (int j = i + 1; j < seqFiles.length; j++) {

Sequence target = getSequence(seqFiles[j]);

double res = aligner.pairwiseAlignment(query, target);

if (res > maxRes) {

bestQuery = query;

bestTarget = target;

}

}

}

List<Sequence> res = new ArrayList();

res.add(bestQuery);

res.add(bestTarget);

return res;

}

public static void main(String[] args) throws Exception {

SubstitutionMatrix matr = new SubstitutionMatrix(DNATools.getDNA(), new File(MATRIX_PATH));

SequenceAlignment aligner = new NeedlemanWunsch(0, 4, 2, 2, 2, matr);

List<Sequence> bestNW = getBestSeq(aligner);

aligner.pairwiseAlignment(bestNW.get(0), bestNW.get(1));

System.out.println("Alignment Needleman-Wunsch : " + aligner.getAlignmentString());

aligner = new SmithWaterman(0, 4, 2, 2, 2, matr);

List<Sequence> bestSW = getBestSeq(aligner);

aligner.pairwiseAlignment(bestSW.get(0), bestSW.get(1));

System.out.println("Alignment Smith-Woterman : " + aligner.getAlignmentString());

}

}