Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
drpatelh committed Oct 2, 2022
1 parent 6428b3f commit ed10bb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
13 changes: 3 additions & 10 deletions bin/igv_files_to_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
############################################

Description = 'Create IGV session file from a list of files and associated colours - ".bed", ".bw", ".bigwig", ".tdf", ".gtf" files currently supported.'
Epilog = (
"""Example usage: python igv_files_to_session.py <XML_OUT> <LIST_FILE> <GENOME>"""
)
Epilog = """Example usage: python igv_files_to_session.py <XML_OUT> <LIST_FILE> <GENOME>"""

argParser = argparse.ArgumentParser(description=Description, epilog=Epilog)

Expand Down Expand Up @@ -109,10 +107,7 @@ def igv_files_to_session(XMLOut, ListFile, ReplaceFile, Genome, PathPrefix=""):

## ADD RESOURCES SECTION
XMLStr = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'
XMLStr += (
'<Session genome="%s" hasGeneTrack="true" hasSequenceTrack="true" locus="All" version="8">\n'
% (Genome)
)
XMLStr += '<Session genome="%s" hasGeneTrack="true" hasSequenceTrack="true" locus="All" version="8">\n' % (Genome)
XMLStr += "\t<Resources>\n"
for ifile, colour in fileList:
XMLStr += '\t\t<Resource path="%s"/>\n' % (ifile)
Expand Down Expand Up @@ -149,9 +144,7 @@ def igv_files_to_session(XMLOut, ListFile, ReplaceFile, Genome, PathPrefix=""):
'\t\t<Track altColor="0,0,178" autoScale="false" clazz="org.broad.igv.track.FeatureTrack" color="%s" '
% (colour)
)
XMLStr += (
'displayMode="COLLAPSED" featureVisibilityWindow="-1" fontSize="10" '
)
XMLStr += 'displayMode="COLLAPSED" featureVisibilityWindow="-1" fontSize="10" '
XMLStr += (
'id="%s" name="%s" renderer="BASIC_FEATURE" sortable="false" visible="true" windowFunction="count"/>\n'
% (ifile, os.path.basename(ifile))
Expand Down
4 changes: 2 additions & 2 deletions modules/local/igv.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ process IGV {
path ("${aligner_dir}/mergedLibrary/macs2/${peak_dir}/*")
path ("${aligner_dir}/mergedLibrary/macs2/${peak_dir}/consensus/*")
path ("mappings/*")

output:
path "*files.txt" , emit: txt
path "*.xml" , emit: xml
Expand All @@ -34,7 +34,7 @@ process IGV {
if [ -d "mappings" ]; then
cat mappings/* > replace_paths.txt
fi
cat *.igv.txt > igv_files_orig.txt
igv_files_to_session.py igv_session.xml igv_files_orig.txt replace_paths.txt ../../genome/${fasta.getName()} --path_prefix '../../'
Expand Down

0 comments on commit ed10bb9

Please sign in to comment.