changeset 5:48d7b2dddae6 draft

Deleted selected files
author yating-l
date Thu, 22 Dec 2016 15:58:55 -0500
parents 67fab89033f2
children 9193fe3ee73f
files Bam.py Bed.py hubarchivecreator
diffstat 3 files changed, 0 insertions(+), 341 deletions(-) [+]
line wrap: on
line diff
--- a/Bam.py	Thu Dec 22 15:56:35 2016 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf8 -*-
-
-"""
-Class to handle Bam files to UCSC TrackHub
-"""
-
-import logging
-import os
-import shutil
-
-from Datatype import Datatype
-from Track import Track
-from TrackDb import TrackDb
-from util import subtools
-
-
-class Bam( Datatype ):
-    def __init__(self, input_bam_false_path, data_bam):
-        super(Bam, self).__init__()
-
-        self.track = None
-
-        self.input_bam_false_path = input_bam_false_path
-
-        self.data_bam = data_bam
-        # TODO: Check if it already contains the .bam extension / Do a function in Datatype which check the extension
-        if ".bam" not in self.data_bam["name"]:
-            self.name_bam = self.data_bam["name"] + ".bam"
-        else:
-            self.name_bam = self.data_bam["name"]
-
-        self.priority = self.data_bam["order_index"]
-        self.index_bam = self.data_bam["index"]
-        # TODO: Think about how to avoid repetition of the color treatment
-        self.track_color = self.data_bam["track_color"]
-
-        # TODO: Think about how to avoid repetition of the group_name everywhere
-        self.group_name = self.data_bam["group_name"]
-
-        # First: Add the bam file
-        # Second: Add the bam index file, in the same folder (https://genome.ucsc.edu/goldenpath/help/bam.html)
-
-        bam_file_path = os.path.join(self.myTrackFolderPath, self.name_bam)
-        shutil.copyfile(self.input_bam_false_path, bam_file_path)
-
-        # Create and add the bam index file to the same folder
-        name_index_bam = self.name_bam + ".bai"
-        bam_index_file_path = os.path.join(self.myTrackFolderPath, name_index_bam)
-        shutil.copyfile(self.index_bam, bam_index_file_path)
-
-        # Create the Track Object
-        self.createTrack(file_path=self.name_bam,
-                         track_name=self.name_bam,
-                         long_label=self.name_bam, track_type='bam', visibility='pack', priority=self.priority,
-                         track_file=bam_index_file_path,
-                         track_color=self.track_color,
-                         group_name=self.group_name
-                         )
-        #
-        # dataURL = "tracks/%s" % self.name_bam
-        #
-        # trackDb = TrackDb(
-        #     trackName=self.name_bam,
-        #     longLabel=self.name_bam,
-        #     shortLabel=self.getShortName( self.name_bam ),
-        #     trackDataURL=dataURL,
-        #     trackType='bam',
-        #     visibility='pack',
-        #     priority=self.priority,
-        # )
-        #
-        # # Return the Bam Track Object
-        # self.track = Track(
-        #     trackFile=bam_index_file_path,
-        #     trackDb=trackDb,
-        # )
-
-        print("- Bam %s created" % self.name_bam)
-        #print("- %s created in %s" % (self.name_bam, bam_file_path))
-        #print("- %s created in %s" % (self.index_bam, bam_index_file_path))
--- a/Bed.py	Thu Dec 22 15:56:35 2016 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-#!/usr/bin/python
-
-import os
-import tempfile
-
-# Internal dependencies
-from Datatype import Datatype
-from Track import Track
-from TrackDb import TrackDb
-from util import subtools
-
-
-class Bed( Datatype ):
-    def __init__( self, inputBedGeneric, data_bed_generic):
-        super(Bed, self).__init__()
-
-        self.track = None
-
-        self.inputBedGeneric = inputBedGeneric
-
-        self.sortedBedFile = tempfile.NamedTemporaryFile(suffix=".sortedBed")
-
-        self.data_bed_generic = data_bed_generic
-        self.name_bed_generic = self.data_bed_generic["name"]
-        self.priority = self.data_bed_generic["order_index"]
-        self.track_color = self.data_bed_generic["track_color"]
-        # TODO: Think about how to avoid repetition of the group_name everywhere
-        self.group_name = self.data_bed_generic["group_name"]
-
-
-        # Sort processing
-        subtools.sort(self.inputBedGeneric, self.sortedBedFile.name)
-
-        # bedToBigBed processing
-        # TODO: Change the name of the bb, to tool + genome + possible adding if multiple +  .bb
-        trackName = "".join( ( self.name_bed_generic, ".bb") )
-
-        myBigBedFilePath = os.path.join(self.myTrackFolderPath, trackName)
-        with open(myBigBedFilePath, 'w') as self.bigBedFile:
-            subtools.bedToBigBed(self.sortedBedFile.name,
-                                 self.chromSizesFile.name,
-                                 self.bigBedFile.name)
-
-        # Create the Track Object
-        self.createTrack(file_path=trackName,
-                         track_name=trackName,
-                         long_label=self.name_bed_generic, track_type='bigBed', visibility='dense',
-                         priority=self.priority,
-                         track_file=myBigBedFilePath,
-                         track_color=self.track_color,
-                         group_name=self.group_name)
-
-        # dataURL = "tracks/%s" % trackName
-        #
-        # trackDb = TrackDb(
-        #     trackName=trackName,
-        #     longLabel=self.name_bed_generic,
-        #     shortLabel=self.getShortName(self.name_bed_generic),
-        #     trackDataURL=dataURL,
-        #     trackType='bigBed',
-        #     visibility='dense',
-        #     thickDrawItem='on',
-        #     priority=self.priority,
-        # )
-        #
-        # # Return the BigBed track
-        # self.track = Track(
-        #     trackFile=myBigBedFilePath,
-        #     trackDb=trackDb,
-        # )
-
-        print("- Bed %s created" % self.name_bed_generic)
-        #print("- %s created in %s" % (trackName, myBigBedFilePath))
--- a/hubarchivecreator	Thu Dec 22 15:56:35 2016 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
-<head>
-<link rel="icon" href="/repos/yating-l/hubarchivecreator/static/hgicon.png" type="image/png" />
-<meta name="robots" content="index, nofollow" />
-<link rel="stylesheet" href="/repos/yating-l/hubarchivecreator/static/style-paper.css" type="text/css" />
-<script type="text/javascript" src="/repos/yating-l/hubarchivecreator/static/mercurial.js"></script>
-
-<title>hubarchivecreator: log</title>
-<link rel="alternate" type="application/atom+xml"
-   href="/repos/yating-l/hubarchivecreator/atom-log" title="Atom feed for hubarchivecreator" />
-<link rel="alternate" type="application/rss+xml"
-   href="/repos/yating-l/hubarchivecreator/rss-log" title="RSS feed for hubarchivecreator" />
-</head>
-<body>
-
-<div class="container">
-<div class="menu">
-<div class="logo">
-<a href="https://mercurial-scm.org/">
-<img src="/repos/yating-l/hubarchivecreator/static/hglogo.png" alt="mercurial" /></a>
-</div>
-<ul>
-<li class="active">log</li>
-<li><a href="/repos/yating-l/hubarchivecreator/graph/tip">graph</a></li>
-<li><a href="/repos/yating-l/hubarchivecreator/tags">tags</a></li>
-<li><a href="/repos/yating-l/hubarchivecreator/bookmarks">bookmarks</a></li>
-<li><a href="/repos/yating-l/hubarchivecreator/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/repos/yating-l/hubarchivecreator/rev/tip">changeset</a></li>
-<li><a href="/repos/yating-l/hubarchivecreator/file/tip">browse</a></li>
-</ul>
-<ul>
-
-<li>
-<a href="/repos/yating-l/hubarchivecreator/archive/tip.tar.bz2">bz2</a>
-</li>
-<li>
-<a href="/repos/yating-l/hubarchivecreator/archive/tip.zip">zip</a>
-</li>
-<li>
-<a href="/repos/yating-l/hubarchivecreator/archive/tip.tar.gz">gz</a>
-</li>
-</ul>
-<ul>
- <li><a href="/repos/yating-l/hubarchivecreator/help">help</a></li>
-</ul>
-<div class="atom-logo">
-<a href="/repos/yating-l/hubarchivecreator/atom-log" title="subscribe to atom feed">
-<img class="atom-logo" src="/repos/yating-l/hubarchivecreator/static/feed-icon-14x14.png" alt="atom feed" />
-</a>
-</div>
-</div>
-
-<div class="main">
-<h2 class="breadcrumb"><a href="/">Mercurial</a> &gt; <a href="/repos">repos</a> &gt; <a href="/repos/yating-l">yating-l</a> &gt; <a href="/repos/yating-l/hubarchivecreator">hubarchivecreator</a> </h2>
-<h3>log</h3>
-
-<form class="search" action="/repos/yating-l/hubarchivecreator/log">
-
-<p><input name="rev" id="search1" type="text" size="30" value="" /></p>
-<div id="hint">Find changesets by keywords (author, files, the commit message), revision
-number or hash, or <a href="/repos/yating-l/hubarchivecreator/help/revsets">revset expression</a>.</div>
-</form>
-
-<div class="navigate">
-<a href="/repos/yating-l/hubarchivecreator/shortlog/tip?revcount=30">less</a>
-<a href="/repos/yating-l/hubarchivecreator/shortlog/tip?revcount=120">more</a>
-| rev 8: <a href="/repos/yating-l/hubarchivecreator/shortlog/3e0c61b52a06">(0)</a> <a href="/repos/yating-l/hubarchivecreator/shortlog/tip">tip</a> 
-</div>
-
-<table class="bigtable">
-<thead>
- <tr>
-  <th class="age">age</th>
-  <th class="author">author</th>
-  <th class="description">description</th>
- </tr>
-</thead>
-<tbody class="stripes2">
- <tr>
-  <td class="age">Thu, 22 Dec 2016 15:32:27 -0500</td>
-  <td class="author">yating-l</td>
-  <td class="description">
-   <a href="/repos/yating-l/hubarchivecreator/rev/be8fd2f24c60">planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit e2db8aa3672f1222b415716054bfb3c5ccd132a1-dirty</a>
-   <span class="branchhead">default</span> <span class="tag">tip</span> 
-  </td>
- </tr>
- <tr>
-  <td class="age">Thu, 22 Dec 2016 14:21:03 -0500</td>
-  <td class="author">yating-l</td>
-  <td class="description">
-   <a href="/repos/yating-l/hubarchivecreator/rev/dd1e233e16a1">planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit e61ffe1cf3150efe264a35e6287dc60a70d4e526</a>
-   
-  </td>
- </tr>
- <tr>
-  <td class="age">Wed, 21 Dec 2016 18:00:09 -0500</td>
-  <td class="author">yating-l</td>
-  <td class="description">
-   <a href="/repos/yating-l/hubarchivecreator/rev/2cc7685a7182">planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 48b59e91e2dcc2e97735ee35d587960cbfbce932</a>
-   
-  </td>
- </tr>
- <tr>
-  <td class="age">Wed, 21 Dec 2016 17:26:51 -0500</td>
-  <td class="author">yating-l</td>
-  <td class="description">
-   <a href="/repos/yating-l/hubarchivecreator/rev/7b0d359de7ee">planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit e2db8aa3672f1222b415716054bfb3c5ccd132a1-dirty</a>
-   
-  </td>
- </tr>
- <tr>
-  <td class="age">Wed, 21 Dec 2016 12:09:58 -0500</td>
-  <td class="author">yating-l</td>
-  <td class="description">
-   <a href="/repos/yating-l/hubarchivecreator/rev/9018229c0969">planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test commit 48b59e91e2dcc2e97735ee35d587960cbfbce932-dirty</a>
-   
-  </td>
- </tr>
- <tr>
-  <td class="age">Wed, 21 Dec 2016 11:18:27 -0500</td>
-  <td class="author">yating-l</td>
-  <td class="description">
-   <a href="/repos/yating-l/hubarchivecreator/rev/44577d6784b7">planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit e2db8aa3672f1222b415716054bfb3c5ccd132a1-dirty</a>
-   
-  </td>
- </tr>
- <tr>
-  <td class="age">Tue, 22 Nov 2016 17:13:18 -0500</td>
-  <td class="author">yating-l</td>
-  <td class="description">
-   <a href="/repos/yating-l/hubarchivecreator/rev/4ced8f116509">planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty</a>
-   
-  </td>
- </tr>
- <tr>
-  <td class="age">Tue, 22 Nov 2016 17:07:47 -0500</td>
-  <td class="author">yating-l</td>
-  <td class="description">
-   <a href="/repos/yating-l/hubarchivecreator/rev/42337785f87b">Uploaded</a>
-   
-  </td>
- </tr>
- <tr>
-  <td class="age">Mon, 31 Oct 2016 16:36:25 -0400</td>
-  <td class="author">yating-l</td>
-  <td class="description">
-   <a href="/repos/yating-l/hubarchivecreator/rev/3e0c61b52a06">planemo upload for repository https://github.com/Yating-L/hub-archive-creator commit a77635b40ebd29baafb3bea57f8cbfb3f252e3b0-dirty</a>
-   
-  </td>
- </tr>
-
-</tbody>
-</table>
-
-<div class="navigate">
-<a href="/repos/yating-l/hubarchivecreator/shortlog/tip?revcount=30">less</a>
-<a href="/repos/yating-l/hubarchivecreator/shortlog/tip?revcount=120">more</a>
-| rev 8: <a href="/repos/yating-l/hubarchivecreator/shortlog/3e0c61b52a06">(0)</a> <a href="/repos/yating-l/hubarchivecreator/shortlog/tip">tip</a> 
-</div>
-
-<script type="text/javascript">
-    ajaxScrollInit(
-            '/repos/yating-l/hubarchivecreator/shortlog/%next%',
-            '', <!-- NEXTHASH
-            function (htmlText, previousVal) {
-                var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
-                return m ? m[1] : null;
-            },
-            '.bigtable > tbody',
-            '<tr class="%class%">\
-            <td colspan="3" style="text-align: center;">%text%</td>\
-            </tr>'
-    );
-</script>
-
-</div>
-</div>
-
-<script type="text/javascript">process_dates()</script>
-
-
-</body>
-</html>
-