Skip to content
Snippets Groups Projects
Commit 734f5d20 authored by Saulo Aflitos's avatar Saulo Aflitos
Browse files

run.sh

parent 8491a61d
Branches develop
No related tags found
No related merge requests found
Pipeline #
......@@ -2,3 +2,4 @@ data/*
*.tar.xz
*.pyc
Thumbs.db
*~
genomes = {
'ath': {
'name' : 'Arabidopsis thaliana',
'folder': 'arabidopsis_thaliana',
'prefix': 'Arabidopsis_thaliana.TAIR10.18.dna.chromosome.',
'begin' : 1,
'end' : 5,
'fmt' : '%d'
},
'bol': {
'name' : 'Brassica oleracea',
'folder': 'brassica_oleracea',
'prefix': '',
'begin' : 1,
'end' : 9,
'fmt' : '%d'
'sly': {
'name' : 'Solanum lycopersicum',
'folder': 'Solanum_lycopersicum',
'prefix': 'SL2.40ch',
'begin' : 0,
'end' : 12,
'fmt' : '%02d'
},
'bra': {
'name' : 'Brassica rapa',
'folder': 'brassica_rapa',
'prefix': 'chrA',
'stu': {
'name' : 'Solanum tuberosum',
'folder': 'Solanum_tuberosum',
'prefix': 'ST4.03ch',
'begin' : 1,
'end' : 10,
'end' : 12,
'fmt' : '%02d'
}
}
......@@ -31,6 +23,7 @@ notindestiny = ['slyref']
dosymetrical = False
doreciprocal = True
create_make_file = True
create_html = False
#maxX = 1
#maxY = 2
......@@ -192,8 +192,11 @@ class exp(object):
self.linec += 1
minx = x1 if x1 < x2 else x2
maxx = x1 if x1 > x2 else x2
minx = x1 if (x1 < x2) else x2
maxx = x1 if (x1 > x2) else x2
print "minx %d maxx %d x1 %d x2 %d" % (minx, maxx, x1, x2)
assert minx < maxx, "minx (%d) > maxx(%d) for %s" % (minx, maxx, name)
if name not in self.tgts:
self.tgts[name] = len(self.tgts)
......@@ -207,7 +210,8 @@ class exp(object):
gffId = "%s_frag_%05d" % ( refName+'_'+name, len( self.gffReg[ name ] ) )
gffName = "%s_frag_%05d" % ( name, len( self.gffReg[ name ] ) )
self.gffReg[name].append( [refName, '.', 'CDS', minx, maxx, '.', '+' if sense == 'fwd' else '-', len( self.gffReg[ name ] )-1, 'ID=%s;Name=%s;Parent=%s' % (gffId, gffName, refName+'_'+name) ] )
#self.gffReg[name].append( [refName, '.', 'CDS', minx, maxx, '.', '+' if sense == 'fwd' else '-', len( self.gffReg[ name ] )-1, 'ID=%s;Name=%s;Parent=%s' % (gffId, gffName, refName+'_'+name) ] )
self.gffReg[name].append( [refName, '.', 'CDS', minx, maxx, '.', '+' if sense == 'fwd' else '-', 0, 'ID=%s;Name=%s;Parent=%s' % (gffId, gffName, refName+'_'+name) ] )
self.gffReg[name][0][4] = maxx
name = self.tgts[name]
......@@ -321,10 +325,10 @@ def parseDelta(delta):
#print "identity %.2f" % ( idd )
#print
refMin = min( refStart, refEnd )
refMax = max( refStart, refEnd )
tgtMin = min( tgtStart, tgtEnd )
tgtMax = max( tgtStart, tgtEnd )
refMin = min( [refStart, refEnd] )
refMax = max( [refStart, refEnd] )
tgtMin = min( [tgtStart, tgtEnd] )
tgtMax = max( [tgtStart, tgtEnd] )
d = [refStart, refEnd, tgtStart, tgtEnd, refLen, tgtLen, refSub, tgtSub, idd, refName, tgtName]
#print d
......
......@@ -12,6 +12,7 @@ notindestiny = []
dosymetrical = True
doreciprocal = True
create_make_file = True
create_html = False
html2pdf = None
pdf2img = None
maxX = -1
......@@ -162,18 +163,18 @@ def mapgenomes( org1, org2 ):
alt = "%s chr %s vs %s chr %s" % ( org1name, org1str, org2name, org2str )
reportouter.append('\t\t\t\t<td><img src="%s" title="%s"/></td>' % ( outpngl, alt ))
cmd1 = "../nucmer -o -p %s %s %s" % ( outname, org2fasta, org1fasta )
cmd1 = "nucmer -o -p %s %s %s" % ( outname, org2fasta, org1fasta )
makefile.append(outdelta + ': ' + org1fasta + ' ' + org2fasta)
makefile.append('\t%s\n' % cmd1)
cmd2 = '../mummerplot -f -p %s --large --png %s' % ( outdelta, outdelta )
cmd2 = 'mummerplot -f -p %s --large --png %s' % ( outdelta, outdelta )
makefile.append(outpng + ' ' + outfilter + ': ' + outdelta)
#makefile.append('\tif [ $( shell cat %s | wc -l ) -gt 2 ]; then %s; else touch %s; touch %s; fi\n' % (outdelta, cmd2, outpng, outfilter))
makefile.append('\t%s\n' % (cmd2))
outfiles.append(outpng)
cmd3 = '../show-aligns -r %s.filter "%s" "%s" > %s' % (outdelta, org2seqname, org1seqname, outaln)
cmd3 = 'show-aligns -r %s.filter "%s" "%s" > %s' % (outdelta, org2seqname, org1seqname, outaln)
makefile.append(outaln + ': ' + outfilter)
makefile.append('\t%s\n' % cmd3)
outfiles.append(outaln)
......@@ -494,36 +495,45 @@ def main():
print "creating html"
genHtml(divnames)
print "creating html ok"
if create_html:
print "creating html"
genHtml(divnames)
print "creating html ok"
if create_make_file:
print "creating makefile"
html = 'report.html.tar.xz'
makefile.append(html + ' : '+" ".join( allfiles ))
makefile.append('\ttar --exclude=report.html.png -acvf %s *.html */*.html */*.png\n' % html)
png = 'report.png.tar.xz'
makefile.append(png + ' : '+" ".join( allfiles ))
makefile.append('\ttar -acvf %s */report.html.png\n' % png)
pdf = 'report.pdf.tar.xz'
makefile.append(pdf + ' : '+" ".join( allfiles ))
makefile.append('\ttar -acvf %s */report.html.pdf\n' % pdf)
allf = 'report.all.tar.xz'
makefile.append(allf + ' : '+" ".join( allfiles ))
makefile.append('\ttar -acvf %s *.html */*.html */*.png */*.pdf\n' % allf)
allr = 'report.raw.tar.xz'
makefile.append(allr + ' : '+" ".join( allfiles ))
makefile.append('\ttar -acvf %s */*.coords */*.delta */*.filter */*.aln */*.fplot */*.rplot */*.gp \n' % allr)
allstr = 'all: ' + " ".join( [html, png, pdf, allf, allr] ) + "\n"
makefile.insert(0, allstr)
if create_html:
html = 'report.html.tar.xz'
makefile.append(html + ' : '+" ".join( allfiles ))
makefile.append('\ttar --exclude=report.html.png -acvf %s *.html */*.html */*.png\n' % html)
png = 'report.png.tar.xz'
makefile.append(png + ' : '+" ".join( allfiles ))
makefile.append('\ttar -acvf %s */report.html.png\n' % png)
pdf = 'report.pdf.tar.xz'
makefile.append(pdf + ' : '+" ".join( allfiles ))
makefile.append('\ttar -acvf %s */report.html.pdf\n' % pdf)
allf = 'report.all.tar.xz'
makefile.append(allf + ' : '+" ".join( allfiles ))
makefile.append('\ttar -acvf %s *.html */*.html */*.png */*.pdf\n' % allf)
allr = 'report.raw.tar.xz'
makefile.append(allr + ' : '+" ".join( allfiles ))
makefile.append('\ttar -acvf %s */*.coords */*.delta */*.filter */*.aln */*.fplot */*.rplot */*.gp \n' % allr)
allstr = 'all: ' + " ".join( [html, png, pdf, allf, allr] ) + "\n"
makefile.insert(0, allstr)
else:
allr = 'report.raw.tar.xz'
makefile.append(allr + ' : '+" ".join( allfiles ))
makefile.append('\ttar -acvf %s */*.coords */*.delta */*.filter */*.aln */*.fplot */*.rplot */*.gp \n' % allr)
allstr = 'all: ' + " ".join( [allr] ) + "\n"
makefile.insert(0, allstr)
......
run.sh 0 → 100644
1861 ln -s /media/lidija/bigDisk/W05-SolEtu/00-genomes/ input
1863 mkdir Solanum_tuberosum
1864 cd Solanum_tuberosum/
1865 fastaexplode ../input/SolTub-PGSC_DM_v4.03_pseudomolecules.fasta
1868 cd ..
1869 mkdir Solanum_lycopersicum
1870 cd Solanum_lycopersicum/
1871 fastaexplode ../input/SolLyc-genome-chromosomes.2.40.fa
python mummer_iterate.py config.py
make -f makefile
cd data
../delta2js.py ../config_ath.py ../sly_sly/*.delta ../sly_stu/*.delta ../stu_stu/*.delta
cp ../sly_sly/*.js sly_stu/*.js stu_stu/*.js
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