Skip to content

Commit

Permalink
Merge pull request #91 from josiahseaman/fluentdna_rename
Browse files Browse the repository at this point in the history
Fluentdna Rename
  • Loading branch information
josiahseaman authored Oct 30, 2019
2 parents 1e1d36f + c41439a commit 86e0aa6
Show file tree
Hide file tree
Showing 122 changed files with 208 additions and 192 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ env/
env365/
install_test/
release/
DDV/results/
FluentDNA/results/
release.bat
scraps/
env_fresh/
DDV/data/
DDV/www-data/
FluentDNA/data/
FluentDNA/www-data/


# Created by .ignore support plugin (hsz.mobi)
Expand Down
8 changes: 4 additions & 4 deletions DDV/AnnotatedAlignment.py → FluentDNA/AnnotatedAlignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
import os
from DNASkittleUtils.DDVUtils import editable_str

from DDV.ChainParser import ChainParser, scan_past_header, Batch
from FluentDNA.ChainParser import ChainParser, scan_past_header, Batch
from DNASkittleUtils.Contigs import pluck_contig
from DNASkittleUtils.DDVUtils import first_word, ReverseComplement

from DDV.Annotations import create_fasta_from_annotation, GFF
from FluentDNA.Annotations import create_fasta_from_annotation, GFF


class AnnotatedAlignment(ChainParser):
Expand Down Expand Up @@ -167,5 +167,5 @@ def markup_annotation_differences(self):
aligner.parse_chain(['chr20'])

#### ==== Command Line Configuration === ####
# fluentdna.py --chainfile=hg38ToPanTro4.over.chain --fasta=hg38.fa --extrafastas panTro4.fa --ref_annotation=DDV\\data\Hg38_genes.gtf
# --query_annotation=DDV\data\PanTro_refseq2.1.4_genes.gtf --outname=hg38_panTro4_annotated_
# fluentdna.py --chainfile=hg38ToPanTro4.over.chain --fasta=hg38.fa --extrafastas panTro4.fa --ref_annotation=FluentDNA\\data\Hg38_genes.gtf
# --query_annotation=FluentDNA\data\PanTro_refseq2.1.4_genes.gtf --outname=hg38_panTro4_annotated_
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from itertools import chain
from os.path import join, basename

from DDV.Annotations import create_fasta_from_annotation, find_universal_prefix, parseGFF
from DDV.ParallelGenomeLayout import ParallelLayout
from DDV.DDVUtils import filter_by_contigs, copy_to_sources
from FluentDNA.Annotations import create_fasta_from_annotation, find_universal_prefix, parseGFF
from FluentDNA.ParallelGenomeLayout import ParallelLayout
from FluentDNA.FluentDNAUtils import filter_by_contigs, copy_to_sources


class AnnotatedTrackLayout(ParallelLayout):
Expand Down
10 changes: 5 additions & 5 deletions DDV/AnnotationAlignment.py → FluentDNA/AnnotationAlignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
import os
from DNASkittleUtils.DDVUtils import editable_str

from DDV.ChainParser import ChainParser
from FluentDNA.ChainParser import ChainParser
from DNASkittleUtils.CommandLineUtils import just_the_name
from DDV.RepeatAnnotations import max_consensus_width, read_repeatmasker_csv, \
from FluentDNA.RepeatAnnotations import max_consensus_width, read_repeatmasker_csv, \
filter_repeats_by_chromosome_and_family
from DDV.Span import alignment_chopping_index, AlignedSpans, Span
from DDV.TransposonLayout import TransposonLayout
from DDV.DDVUtils import make_output_directory
from FluentDNA.Span import alignment_chopping_index, AlignedSpans, Span
from FluentDNA.TransposonLayout import TransposonLayout
from FluentDNA.FluentDNAUtils import make_output_directory


def create_aligned_annotation_fragments(alignment, repeat_entries):
Expand Down
8 changes: 4 additions & 4 deletions DDV/Annotations.py → FluentDNA/Annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from DNASkittleUtils.Contigs import Contig, read_contigs, write_contigs_to_file

from DNASkittleUtils.DDVUtils import editable_str
from DDV import gap_char
from FluentDNA import gap_char

try:
from urllib.parse import unquote
Expand Down Expand Up @@ -363,12 +363,12 @@ def find_universal_prefix(annotation_list):


if __name__ == '__main__':
# annotation = r'DDV\data\Pan_Troglodytes_refseq2.1.4.gtf'
# annotation = r'FluentDNA\data\Pan_Troglodytes_refseq2.1.4.gtf'
# target_chromosome = 'chr20'
# create_fasta_from_annotation(annotation, target_chromosome, 'Chimp_test_' + target_chromosome + '.fa')

# annotation = r'DDV\data\Pan_Troglodytes_refseq2.1.4.gtf'
# annotation = r'DDV\data\Homo_Sapiens_GRCH38_trimmed.gtf'
# annotation = r'FluentDNA\data\Pan_Troglodytes_refseq2.1.4.gtf'
# annotation = r'FluentDNA\data\Homo_Sapiens_GRCH38_trimmed.gtf'
# purge_annotation(annotation)
path = r"E:\Genomes\Human\Human Unique Annotation merged.fa"
squished = squish_fasta(read_contigs(path), 20, 100)
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions DDV/ChainParser.py → FluentDNA/ChainParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
from DNASkittleUtils.CommandLineUtils import just_the_name
from DNASkittleUtils.Contigs import pluck_contig, write_complete_fasta
from DNASkittleUtils.DDVUtils import first_word, ReverseComplement, BlankIterator, editable_str
from DDV.DefaultOrderedDict import DefaultOrderedDict
from DDV.ChainFiles import chain_file_to_list, match
from DDV.DDVUtils import make_output_directory, keydefaultdict, read_contigs_to_dict, copy_to_sources
from DDV.Span import AlignedSpans, Span, alignment_chopping_index
from DDV import gap_char
from DDV.TileLayout import hex_to_rgb
from FluentDNA.DefaultOrderedDict import DefaultOrderedDict
from FluentDNA.ChainFiles import chain_file_to_list, match
from FluentDNA.FluentDNAUtils import make_output_directory, keydefaultdict, read_contigs_to_dict, copy_to_sources
from FluentDNA.Span import AlignedSpans, Span, alignment_chopping_index
from FluentDNA import gap_char
from FluentDNA.TileLayout import hex_to_rgb

Batch = namedtuple('Batch', ['chr', 'fastas', 'output_folder'])

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions DDV/DDVUtils.py → FluentDNA/FluentDNAUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def read_contigs_to_dict(input_file_path, extract_contigs=None):


def create_deepzoom_stack(input_image, output_dzi):
import DDV.deepzoom
creator = DDV.deepzoom.ImageCreator(tile_size=256,
import FluentDNA.deepzoom
creator = FluentDNA.deepzoom.ImageCreator(tile_size=256,
tile_overlap=1,
tile_format="png",
resize_filter="antialias")# cubic bilinear bicubic nearest antialias
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import sys
from PIL import Image, ImageFont

from DDV.Annotations import GFFAnnotation, find_universal_prefix, GFF3Record, parseGFF
from DDV.Span import Span
from DDV.TileLayout import TileLayout
from DDV.DDVUtils import linspace, copy_to_sources
from FluentDNA.Annotations import GFFAnnotation, find_universal_prefix, GFF3Record, parseGFF
from FluentDNA.Span import Span
from FluentDNA.TileLayout import TileLayout
from FluentDNA.FluentDNAUtils import linspace, copy_to_sources


def blend_pixel(markup_canvas, pt, c, overwrite=False):
Expand Down
6 changes: 3 additions & 3 deletions DDV/Ideogram.py → FluentDNA/Ideogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

from DNASkittleUtils.Contigs import read_contigs

from DDV.DDVUtils import beep
from DDV.HighlightedAnnotation import HighlightedAnnotation
from FluentDNA.FluentDNAUtils import beep
from FluentDNA.HighlightedAnnotation import HighlightedAnnotation
import os
import numpy as np
from functools import reduce

from DDV.Layouts import LayoutFrame, LayoutLevel
from FluentDNA.Layouts import LayoutFrame, LayoutLevel


class IdeogramCoordinateFrame(LayoutFrame):
Expand Down
2 changes: 1 addition & 1 deletion DDV/Layouts.py → FluentDNA/Layouts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
from PIL import Image, ImageDraw
from DDV.DDVUtils import multi_line_height
from FluentDNA.FluentDNAUtils import multi_line_height


class LayoutLevel(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from PIL import Image, ImageDraw

import math
from DDV.TileLayout import hex_to_rgb, TileLayout, is_protein_sequence
from FluentDNA.TileLayout import hex_to_rgb, TileLayout, is_protein_sequence
from natsort import natsorted

from DDV.DDVUtils import make_output_directory
from DDV.Layouts import level_layout_factory
from FluentDNA.FluentDNAUtils import make_output_directory
from FluentDNA.Layouts import level_layout_factory


def fastas_in_folder(input_fasta_folder):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from PIL import ImageFont, Image

from DNASkittleUtils.CommandLineUtils import just_the_name
from DDV.TileLayout import TileLayout, hex_to_rgb
from DDV.Layouts import level_layout_factory
from FluentDNA.TileLayout import TileLayout, hex_to_rgb
from FluentDNA.Layouts import level_layout_factory


class ParallelLayout(TileLayout):
Expand Down Expand Up @@ -102,11 +102,11 @@ def draw_border_boxes(self, fasta_files):
To help keep track of it correctly, ParallelGenomeLayout demarcates bundles of columns that go
together. Mouse over gives further information on each file."""
from DNASkittleUtils.DDVUtils import pp
from DDV.DDVUtils import execution_dir
from FluentDNA.FluentDNAUtils import execution_dir
base_dir = execution_dir()
# Caution: These corners are currently hard coded to the color and dimension of one image
try:
corner = Image.open(os.path.join(base_dir,'DDV','html_template','img','border_box_corner.png'))
corner = Image.open(os.path.join(base_dir,'FluentDNA','html_template','img','border_box_corner.png'))
except FileNotFoundError:
corner = Image.open(os.path.join(base_dir, 'html_template', 'img', 'border_box_corner.png'))
corner_rb = corner.copy().rotate(270, expand=True)
Expand Down
4 changes: 2 additions & 2 deletions DDV/RepeatAnnotations.py → FluentDNA/RepeatAnnotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from DNASkittleUtils.Contigs import pluck_contig
from DNASkittleUtils.DDVUtils import rev_comp

from DDV.Span import Span
from DDV import gap_char
from FluentDNA.Span import Span
from FluentDNA import gap_char


def int_log(num):
Expand Down
2 changes: 1 addition & 1 deletion DDV/Span.py → FluentDNA/Span.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
original and gapped sequence as gaps are added."""
from __future__ import print_function, division, absolute_import, \
with_statement, generators, nested_scopes
from DDV import gap_char
from FluentDNA import gap_char

class Span(object):
""" Span can have sections in the middle removed, creating two or less new Spans.
Expand Down
16 changes: 8 additions & 8 deletions DDV/TileLayout.py → FluentDNA/TileLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
from DNASkittleUtils.DDVUtils import copytree
from PIL import Image, ImageDraw, ImageFont

from DDV import gap_char
from DDV.DDVUtils import multi_line_height, pretty_contig_name, viridis_palette, \
from FluentDNA import gap_char
from FluentDNA.FluentDNAUtils import multi_line_height, pretty_contig_name, viridis_palette, \
make_output_directory, filter_by_contigs, copy_to_sources
from DDV.Layouts import LayoutFrame, LayoutLevel, level_layout_factory, parse_custom_layout
from FluentDNA.Layouts import LayoutFrame, LayoutLevel, level_layout_factory, parse_custom_layout

small_title_bp = 10000
protein_found_message = False
Expand Down Expand Up @@ -143,7 +143,7 @@ def activate_high_contrast_colors(self):
self.palette['C'] = hex_to_rgb('FF9F00') # Yellow
self.palette['T'] = hex_to_rgb('0B56BE') # Blue originally '0F4FA8'
self.palette['A'] = hex_to_rgb('00C566') # Green originally ' 00B25C'
# Original DDV Colors
# Original FluentDNA Colors
# self.palette['A'] = (255, 0, 0)
# self.palette['G'] = (0, 255, 0)
# self.palette['T'] = (250, 240, 114)
Expand Down Expand Up @@ -425,14 +425,14 @@ def get_font(self, font_size):
if font_size in self.fonts:
font = self.fonts[font_size]
else:
from DDV.DDVUtils import execution_dir
from FluentDNA.FluentDNAUtils import execution_dir
base_dir = execution_dir()
try:
with open(os.path.join(base_dir, 'html_template', 'img', "ariblk.ttf"), 'rb') as font_file:
font = ImageFont.truetype(font_file, font_size)
except IOError:
try:
with open(os.path.join(base_dir, 'DDV', 'html_template', 'img', "ariblk.ttf"), 'rb') as font_file:
with open(os.path.join(base_dir, 'FluentDNA', 'html_template', 'img', "ariblk.ttf"), 'rb') as font_file:
font = ImageFont.truetype(font_file, font_size)
except IOError:
print("Unable to load ariblk.ttf size:%i" % font_size)
Expand Down Expand Up @@ -527,8 +527,8 @@ def generate_html(self, output_folder, output_file_name, overwrite_files=True):
print(html_path, ' already exists. Skipping HTML.')
return
try:
import DDV
module_path = os.path.dirname(DDV.__file__)
import FluentDNA
module_path = os.path.dirname(FluentDNA.__file__)
html_template = os.path.join(module_path, 'html_template')
copytree(html_template, output_folder) # copies the whole template directory
print("Copying HTML to", output_folder)
Expand Down
8 changes: 4 additions & 4 deletions DDV/TransposonLayout.py → FluentDNA/TransposonLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

from DNASkittleUtils.Contigs import Contig, read_contigs
from DNASkittleUtils.DDVUtils import rev_comp
from DDV.RepeatAnnotations import read_repeatmasker_csv, max_consensus_width, blank_line_array
from DDV.TileLayout import TileLayout
from DDV import gap_char
from DDV.DDVUtils import copy_to_sources
from FluentDNA.RepeatAnnotations import read_repeatmasker_csv, max_consensus_width, blank_line_array
from FluentDNA.TileLayout import TileLayout
from FluentDNA import gap_char
from FluentDNA.FluentDNAUtils import copy_to_sources


class TransposonLayout(TileLayout):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from bisect import bisect_left
import os
from DNASkittleUtils.Contigs import write_complete_fasta
from DDV import gap_char
from DDV.ChainParser import ChainParser, Batch
from DDV.Span import Span
from DDV.ChainFiles import fetch_all_chains
from FluentDNA import gap_char
from FluentDNA.ChainParser import ChainParser, Batch
from FluentDNA.Span import Span
from FluentDNA.ChainFiles import fetch_all_chains


class UniqueOnlyChainParser(ChainParser):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion DDV/deepzoom.py → FluentDNA/deepzoom.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This copy of deep zoom has been modified for DDV to fix a bug in .create() for png files.
# This copy of deep zoom has been modified for FluentDNA to fix a bug in .create() for png files.
#
#
# Deep Zoom Tools
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
Loading

0 comments on commit 86e0aa6

Please sign in to comment.