Skip to content
Snippets Groups Projects
Commit 501fc6e3 authored by tjc's avatar tjc
Browse files

changes to use Picard

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@11714 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 1d8196ed
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
/* Read
*
* created: 2009
*
* This file is part of Artemis
*
* Copyright(C) 2009 Genome Research Limited
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or(at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
package uk.ac.sanger.artemis.components.alignment;
class Read
{
String qname; // query name
int flag; // bitwise flag
String rname; // reference name
int pos; // leftmost coordinate
short mapq; // MAPping Quality
String cigar; // extended CIGAR string
String mrnm; // Mate Reference sequence NaMe; Ò=Ó if the same as rname
int mpos; // leftmost Mate POSition
int isize; // inferred Insert SIZE
String seq; // query SEQuence; Ò=Ó for a match to the reference; n/N/. for ambiguity
public String toString()
{
return qname+"\t"+
flag+"\t"+
rname+"\t"+
pos+"\t"+
mapq+"\t"+
cigar+"\t"+
mrnm+"\t"+
mpos+"\t"+
isize+"\t"+
seq;
}
}
\ No newline at end of file
......@@ -26,6 +26,8 @@ package uk.ac.sanger.artemis.components.alignment;
import java.io.*;
import java.util.List;
import net.sf.samtools.SAMRecord;
/**
* Used to run an samtools process this reads stdout and
* stderr in separate threads.
......@@ -36,7 +38,7 @@ public class RunSamTools
/** running process */
private Process p;
/** standard out */
private List<Read> readsInView;
private List<SAMRecord> readsInView;
/** standard error */
private StringBuffer stderr = new StringBuffer();
private StringBuffer stdout = new StringBuffer();
......@@ -57,7 +59,7 @@ public class RunSamTools
public RunSamTools(String cmd[],
String[] envp,
File project,
List<Read> readsInView)
List<SAMRecord> readsInView)
{
//this.project = project;
this.readsInView = readsInView;
......@@ -156,17 +158,18 @@ public class RunSamTools
{
String fields[] = line.split("\t");
Read pread = new Read();
pread.qname = fields[0];
pread.flag = Integer.parseInt(fields[1]);
pread.rname = fields[2];
pread.pos = Integer.parseInt(fields[3]);
pread.mapq = Short.parseShort(fields[4]);
pread.cigar = fields[5];
pread.mrnm = fields[6];
pread.mpos = Integer.parseInt(fields[7]);
pread.isize = Integer.parseInt(fields[8]);
pread.seq = fields[9];
SAMRecord pread = new SAMRecord(null);
pread.setReadName(fields[0]);
pread.setFlags(Integer.parseInt(fields[1]));
pread.setReferenceName(fields[2]);
pread.setAlignmentStart(Integer.parseInt(fields[3]));
pread.setMappingQuality(Integer.parseInt(fields[4]));
pread.setCigarString(fields[5]);
pread.setMateReferenceName(fields[6]);
pread.setMateAlignmentStart( Integer.parseInt(fields[7]));
pread.setInferredInsertSize(Integer.parseInt(fields[8]));
pread.setReadString(fields[9]);
readsInView.add(pread);
}
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment