Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Commit

Permalink
padding for png
Browse files Browse the repository at this point in the history
  • Loading branch information
lucapinello committed Jun 13, 2017
1 parent 09773a0 commit dbd0f71
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 42 deletions.
16 changes: 8 additions & 8 deletions CRISPResso/CRISPRessoCORE.py
Expand Up @@ -746,9 +746,9 @@ def plot_alleles_table(df_alleles,sgRNA_name,OUTPUT_DIRECTORY,MIN_FREQUENCY=0.5,
ax_hm.yaxis.tick_right()
ax_hm.yaxis.set_ticklabels(y_labels[::-1],rotation=True),
ax_hm.xaxis.set_ticks([])

#print lines

#cut point vertival line
ax_hm.vlines([offset_around_cut_to_plot],*ax_hm.get_ylim(),linestyles='dashed')

Expand Down Expand Up @@ -786,7 +786,7 @@ def main():
)
(
__)__
C\| \
C\| \
\ /
\___/
Expand Down Expand Up @@ -1874,7 +1874,7 @@ def calculate_range(df,column_name):
plt.xlim(xmax=len(args.amplicon_seq)-1)
plt.savefig(_jp('4a.Combined_Insertion_Deletion_Substitution_Locations.pdf'),bbox_extra_artists=(lgd,), bbox_inches='tight')
if args.save_also_png:
plt.savefig(_jp('4a.Combined_Insertion_Deletion_Substitution_Locations.png'),bbox_extra_artists=(lgd,), bbox_inches='tight')
plt.savefig(_jp('4a.Combined_Insertion_Deletion_Substitution_Locations.png'),bbox_extra_artists=(lgd,), bbox_inches='tight',pad=1)


#NHEJ
Expand Down Expand Up @@ -1915,7 +1915,7 @@ def calculate_range(df,column_name):
plt.title('Mutation position distribution of NHEJ')
plt.savefig(_jp('4b.Insertion_Deletion_Substitution_Locations_NHEJ.pdf'),bbox_extra_artists=(lgd,), bbox_inches='tight')
if args.save_also_png:
plt.savefig(_jp('4b.Insertion_Deletion_Substitution_Locations_NHEJ.png'),bbox_extra_artists=(lgd,), bbox_inches='tight')
plt.savefig(_jp('4b.Insertion_Deletion_Substitution_Locations_NHEJ.png'),bbox_extra_artists=(lgd,), bbox_inches='tight',pad=1)


if args.expected_hdr_amplicon_seq:
Expand Down Expand Up @@ -1957,7 +1957,7 @@ def calculate_range(df,column_name):
plt.title('Mutation position distribution of HDR')
plt.savefig(_jp('4c.Insertion_Deletion_Substitution_Locations_HDR.pdf'),bbox_extra_artists=(lgd,), bbox_inches='tight')
if args.save_also_png:
plt.savefig(_jp('4c.Insertion_Deletion_Substitution_Locations_HDR.png'),bbox_extra_artists=(lgd,), bbox_inches='tight')
plt.savefig(_jp('4c.Insertion_Deletion_Substitution_Locations_HDR.png'),bbox_extra_artists=(lgd,), bbox_inches='tight',pad=1)


#MIXED
Expand Down Expand Up @@ -1995,7 +1995,7 @@ def calculate_range(df,column_name):
plt.title('Mutation position distribution of mixed HDR-NHEJ')
plt.savefig(_jp('4d.Insertion_Deletion_Substitution_Locations_Mixed_HDR_NHEJ.pdf'),bbox_extra_artists=(lgd,), bbox_inches='tight')
if args.save_also_png:
plt.savefig(_jp('4d.Insertion_Deletion_Substitution_Locations_Mixed_HDR_NHEJ.png'),bbox_extra_artists=(lgd,), bbox_inches='tight')
plt.savefig(_jp('4d.Insertion_Deletion_Substitution_Locations_Mixed_HDR_NHEJ.png'),bbox_extra_artists=(lgd,), bbox_inches='tight',pad=1)


#Position dependent indels plot
Expand Down Expand Up @@ -2356,7 +2356,7 @@ def save_vector_to_file(vector,name):
)
(
__)__
C\| \
C\| \
\ /
\___/
'''
Expand Down
61 changes: 27 additions & 34 deletions setup.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
"""Description:
"""Description:
Setup script for CRISPResso -- Software pipeline for the analysis of CRISPR-Cas9 genome editing outcomes from deep sequencing data
@status: beta
@version: $Revision$
Expand All @@ -16,7 +16,7 @@
import glob
import subprocess as sb
import sys
import platform
import platform
import shutil
from os.path import expanduser
import urllib
Expand All @@ -40,8 +40,8 @@ def main():
open('CRISPResso/CRISPRessoCORE.py').read(),
re.M
).group(1)


if float(sys.version[:3])<2.6 or float(sys.version[:3])>=2.8:
sys.stdout.write("ERROR: Python version must be 2.6 or 2.7!\n")
sys.exit(1)
Expand All @@ -52,7 +52,7 @@ def main():
include_package_data = True,
packages = ["CRISPResso"],
package_dir={'CRISPResso': 'CRISPResso'},
package_data={'CRISPResso': ['data/*']},
package_data={'CRISPResso': ['data/*']},
entry_points = {
"console_scripts": ['CRISPResso = CRISPResso.CRISPRessoCORE:main',
'CRISPRessoPooled = CRISPResso.CRISPRessoPooledCORE:main',
Expand All @@ -65,12 +65,12 @@ def main():
author='Luca Pinello',
author_email='lpinello@jimmy.harvard.edu',
url='http://github.com/lucapinello/CRISPResso',

classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
Expand All @@ -83,6 +83,7 @@ def main():
'matplotlib>=1.3.1',
'biopython>=1.6.5',
'argparse>=1.3',
'seaborn>=0.7.1',
],

)
Expand Down Expand Up @@ -131,14 +132,14 @@ def check_flash():
sb.call('rm -Rf FLASH-1.2.11',shell=True)
os.chdir('..')
sys.stdout.write('\nFLASh should be installed (please check the output)')

if not check_installation(os.path.join(BIN_FOLDER,'flash'),'flash'):
sys.exit(1)

else:
return False


def check_needle():
if which('needle'):
sys.stdout.write ('\nneedle is already installed!')
Expand All @@ -151,29 +152,29 @@ def check_needle():
urllib.urlretrieve ("ftp://emboss.open-bio.org/pub/EMBOSS/old/6.5.0/EMBOSS-6.5.7.tar.gz",'EMBOSS-6.5.7.tar.gz')
sb.call('tar xvzf EMBOSS-6.5.7.tar.gz',shell=True)
os.chdir('EMBOSS-6.5.7')
cmd_cfg='./configure --prefix=%s --without-x' % INSTALLATION_PATH
cmd_cfg='./configure --prefix=%s --without-x' % INSTALLATION_PATH
sb.call(cmd_cfg,shell=True)
sb.call('make && make install',shell=True)
os.chdir('..')
sb.call('rm -Rf EMBOSS-6.5.7',shell=True)
sb.call('rm EMBOSS-6.5.7.tar.gz',shell=True)
os.chdir('..')
os.chdir('..')
#installa needle
sys.stdout.write('\nneedle should be installed (please check the output)')

if not check_installation(os.path.join(BIN_FOLDER,'needle'),'needle'):
sys.exit(1)
else:
return False

def install_dependencies():

CURRENT_PLATFORM=platform.system().split('_')[0]

if CURRENT_PLATFORM not in ['Linux','Darwin'] and platform.architecture()!='64bit':
sys.stdout.write('Sorry your platform is not supported\n CRISPResso is supported only on 64bit versions of Linux or OSX ')
sys.exit(1)

if not os.path.exists(INSTALLATION_PATH):
sys.stdout.write ('OK, creating the folder:%s' % INSTALLATION_PATH)
os.makedirs(INSTALLATION_PATH)
Expand All @@ -188,31 +189,31 @@ def install_dependencies():


sys.stdout.write( '\nCHECKING DEPENDENCIES...')

flash_already_installed=check_flash()
needle_already_installed=check_needle()
dependencies_already_installed = ( flash_already_installed and needle_already_installed)


if dependencies_already_installed:

pass

else:

#ADD CRISPResso dependencies to PATH
home = expanduser("~")
shell=os.environ["SHELL"].split('/')[-1]

shell_profile=[None,]
line_to_add=None
line_to_add=None

if shell=='bash':
shell_profiles=['.bash_profile','.bashrc']

elif shell=='sh' or shell=='ksh':
shell_profiles=['.profile']

elif shell=='tcsh':
shell_profiles=['.tcshrc']

Expand All @@ -223,9 +224,9 @@ def install_dependencies():
line_to_add='export PATH=%s:$PATH' % BIN_FOLDER
elif shell in ['tcsh','csh']:
line_to_add= 'set path = ( %s $path)' % BIN_FOLDER



for shell_profile in shell_profiles:
cmd_add_path="echo '%s' >> ~/%s" % (line_to_add,shell_profile)
if not os.path.exists(os.path.join(home,shell_profile)) or not line_to_add in open(os.path.join(home,shell_profile)).read():
Expand All @@ -246,11 +247,3 @@ def install_dependencies():
sys.stdout.write ('\n\nChecking dependencies...')
install_dependencies()
sys.stdout.write ('\nAll done!')








0 comments on commit dbd0f71

Please sign in to comment.