{"id":32563017,"url":"https://github.com/smithlabcode/piranha","last_synced_at":"2025-10-29T02:56:15.486Z","repository":{"id":16118524,"uuid":"18863685","full_name":"smithlabcode/piranha","owner":"smithlabcode","description":"Piranha is a peak-caller for CLIP- and RIP-seq data","archived":false,"fork":false,"pushed_at":"2018-02-07T18:02:50.000Z","size":5142,"stargazers_count":18,"open_issues_count":14,"forks_count":16,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-01T00:29:56.817Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smithlabcode.png","metadata":{"files":{"readme":"README.TXT","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-17T02:15:30.000Z","updated_at":"2025-01-28T08:20:38.000Z","dependencies_parsed_at":"2022-09-24T06:20:19.305Z","dependency_job_id":null,"html_url":"https://github.com/smithlabcode/piranha","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/smithlabcode/piranha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smithlabcode%2Fpiranha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smithlabcode%2Fpiranha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smithlabcode%2Fpiranha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smithlabcode%2Fpiranha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smithlabcode","download_url":"https://codeload.github.com/smithlabcode/piranha/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smithlabcode%2Fpiranha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281549786,"owners_count":26520515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-29T02:56:06.247Z","updated_at":"2025-10-29T02:56:15.481Z","avatar_url":"https://github.com/smithlabcode.png","language":"C++","readme":"\n                    _____  _                 _            \n                   |  __ \\(_)               | |           \n                   | |__) |_ _ __ __ _ _ __ | |__   __ _  \n                   |  ___/| | '__/ _` | '_ \\| '_ \\ / _` | \n                   | |    | | | | (_| | | | | | | | (_| | \n                   |_|    |_|_|  \\__,_|_| |_|_| |_|\\__,_|\n                   **************************************\n                   *               V1.2.1               *\n                   ************************************** \n                                        \n\n*********************************\nCopyright and License Information\n*******************************************************************************\nCopyright (C) 2012\nUniversity of Southern California,\nPhilip J. Uren, Andrew D. Smith\n  \nAuthors: Philip J. Uren, Emad Bahrami-Samani, Andrew D. Smith\n  \nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n  \nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n  \nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\nThis software package contains Google Test and BAMTools -- see their \nrespective directories for copyright and license information for those \npackages. \n\n\n*****************\nTable of contents\n*******************************************************************************\n1. Building and Installing Piranha \n2. Basic usage of Piranha \n3. Command-line options of Piranha \n4. Input and output formats of Piranha\n5. Simulation of input data for Piranha\n6. Contacts and bug reports\n\n\n**********************************\n1. Building and Installing Piranha\n*******************************************************************************\nPiranha has been designed to operate in a UNIX-like environment.\nIt has been tested on MacOS X Snow Leopard, USCLinux, Ubuntu and SUSE. We've\nmade every effort to ensure it's compatible with a wide range of systems, but\nwe can't test on all possible platforms and configurations. If you find an\nincompatibility when building or using it, please let us know!\n\nStep 0 -- dependencies and requirements\n---------------------------------------\n  64-bit machine and GCC version \u003e 4.1 (to support TR1). \n  \n  Piranha additionally requires a functioning installation of the GNU \n  Scientific Library (GSL). If you don't already have this installed, you will\n  need to download and install it from http://www.gnu.org/software/gsl/\n  This release has been tested with GSL version 1.14\n  Your installation of GSL must be built for a 64 bit architecture.\n  \n  [OPTIONAL] Tests\n    The regression tests (which you don't need to run, but can to test that \n    Piranha was built correctly) require Python. You can download Python \n    from http://www.python.org/\n    This release has been tested with Python 2.6.1 \n  \n  [OPTIONAL] BAM support\n    If you want BAM support, you must download and build BAMTools.\n    If Piranha cannot find the BAMTools development headers and library,\n    it will be compiled without support for BAM. See below for details on\n    how to specify the location of BAMTools during the build process. \n    BAMTools is available from https://github.com/pezmaster31/bamtools\n    This release has been tested with BAMTools version 2.1.1   \n\nStep 1 -- configuring\n---------------------\n  First configure the installation. To do this, where '\u003e' is your prompt and \n  the CWD is the root of the distribution, type:\n  \n  \u003e ./configure \n  \n  [OPTIONAL] BAM support\n    configure will warn you if BAM support is not available. If you don't want \n    BAM support, this is fine. If you do want it however, and the configure \n    script did not find BAMTools, you will have to specify where the BAMTools \n    development headers and libraries are located. You can do that as follows\n  \n    \u003e ./configure --with-bam_tools_headers=\"/some/path/BAMTools/include/\" \\\n      --with-bam_tools_library=\"/some/path/BAMTools/lib/\"\n  \n    the command is split into two lines here for aesthetic reasons, but it \n    need not be so. There are a few caveats:\n      * If you subsequently move the BAMTools library, Piranha will not work.\n        (this should be obvious really).\n      * The BAMTools installer currently doesn't update the linker info \n        after installation. That means you might install it, but Piranha will\n        still not find it when running ./configure -- in this case, I suggest\n        manually specifying the location as shown above.\n\nStep 2 -- building\n------------------\n  \n  To build the binaries, type the following, where '\u003e' is your prompt and the\n  CWD is the root of the distribution  \n  \n  \u003e make all \n  \nStep 3 -- installing\n--------------------\n  To install the binaries, type the following, where '\u003e' is your prompt and the\n  CWD is the root of the distribution\n  \n  \u003e make install\n  \n  This will place the binaries in the bin directory under the package root.\n  They can be used directly from there without any additional steps. You can\n  add that directory to your PATH environment variable to avoid having to \n  specify their full paths, or you can copy the binaries to another directory\n  of your choice in your PATH.\n  \nStep 4 -- testing [OPTIONAL]\n----------------------------\n  You can verify that Piranha was built correctly by running the included\n  unit and regression tests. At the command prompt (assuming your prompt is \n  '\u003e') type the following:\n  \n  \u003e make test \n  \n  \n*************************\n2. Basic usage of Piranha \n*******************************************************************************\nPiranha has two main modes of operation. In the first, a single regular \ndistribution is fit to the input data and each region is assigned a p-value\nbased on this distribution. The default distribution is the zero-truncated \nnegative binomial. To run Piranha in this way, use the following, where \u003e is \nyour prompt  \n\n\u003e ./Piranha input.bed\n\nThe second mode of operation fits a regression model relating counts to \ncovariates. The default is a zero-truncated negative binomial regression. To\nrun Piranha in this way, do the following, where \u003e is your prompt \n\n\u003e ./Piranha input.bed covariate1.bed covariate2.bed\n\nNote that the first file is always assumed to be the counts, and the remaining\nfiles are assumed to be covariates. \n\nFor further options, run Piranha without any arguments, or see the section \n'Command Line Options' below.\n\n\n**********************************\n3. Command-line options of Piranha \n*******************************************************************************\nUsage: Piranha [OPTIONS] *.bed\n\nOptions:\n  -o, -output             Name of output file, STDOUT if omitted \n  -s, -sort               indicates that input is unsorted and Piranha should \n                          sort it for you\n  -p, -p_threshold        significance threshold for sites \n  -a, -background_thresh  indicates that this proportion of the lowest scores \n                          should be considered the background. Default is 0.99\n  -b, -bin_size           indicates that input is raw reads and should be binned \n                          into bins of this size \n  -i, -bin_size_covars    indicates that the covariates (all except first \n                          file) are raw reads and should be binned into bins of \n                          this size \n  -z, -bin_size_both      synonymous with -b x -i x for any x \n  -u, -cluster_dist       merge significant bins within this distance. \n                          Setting to 0 disables merging, default is 1 (merge \n                          adjacent) \n  -r, -suppress_covars    don't print covariate values in output\n  -f, -fit                Fit only, output model to file \n  -d, -dist               Distribution type. Currently supports Poisson, \n                          NegativeBinomial, ZeroTruncatedPoisson, \n                          ZeroTruncatedNegativeBinomial, \n                          PoissonRegression, NegativeBinomialRegression, \n                          ZeroTruncatedPoissonRegression, \n                          ZeroTruncatedNegativeBinomialRegression \n  -t, -fitMethod          component fitting method \n  -m, -model              Use the specified model file instead of fitting to \n                          input data \n  -v, -VERBOSE            output additional messages about run to stderr if set \n  -x, -unstranded         Don't preserve strand (puts all the peaks in positive \n                          strand) \n  -n, -no_normalisation   don't normalise covariates \n  -l, -log_covars         convert covariates to log scale \n\nHelp options:\n  -?, -help               print this help message \n      -about              print about message \n \n\n\n**************************************\n4. Input and output formats of Piranha\n*******************************************************************************\n    NOTE: BAM support is only available if Piranha was linked with BAMTools\n    =======================================================================\n \nPiranha takes three possible inputs:\n  1.) The response file   (BED or BAM format) [REQUIRED]\n  2.) The covariate files (BED format)        [OPTIONAL]      \n  3.) The model file      (XML format)        [OPTIONAL]\n  \nThe response file (always the first argument, and required) may contain:\n  1.) Binned read counts. In this case the input can be provided in BED \n      format, but not BAM format. The Score field of the BED format file will \n      be treated as the count of the number of reads mapping into that bin. \n      This is the default and is what is expected if no contrary options are \n      specified.\n  2.) Raw read locations, in which case Piranha will bin the reads for you. \n      If you provide your input like this, you MUST set the bin size option, \n      or Piranha will treat your input as being already binned. If Piranha is \n      creating bins from raw reads, it will always start at the first index of \n      each chromosome (i.e. index 1) and move at a step size equal to the bin \n      size. Bins with no reads in them will not be retained. \nThe file format will be determined by looking at the file extension (.bam or \n.bed). Case is not important; unknown extensions are treated as .bed files. \n\nThe covariates files are optional. You can provide one or more of them.\nIf none are provided, the program fits a regular distribution (zero-truncated \nnegative binomial by default) to the read counts. If covariates are provided,\nthe program performs regression (zero truncated negative binomial regression\nby default) using the provided covariates. Covariates must be provided in\nBED format, where the score field (the fifth) is taken as value of the \ncovariate for the genomic region defined by the other fields. Every covariate\nfile must contain genomic loci that match the response file.\n\nPiranha has a special option for handling the case where a single covariate\nis present and this covariate is the number of reads from another sequencing\nrun (for example, a control IP in the case of RIP or an RNA-seq experiment\nin the case of CLIP). In this case, the covariate can be provided as a BED\nfile that contains the raw read locations; the -i option should be used to\nindicate that the covariate file is raw reads -- Piranha will then bin these\nreads into bins that match the response.\n\nPiranha's output is a tab delimited file with the input regions from the \nresponse (in BED format) and a single additional column giving the p-value \nfor each bin. If covariates were provided, additional columns are added\ncontaining the value of each of the covariates for the given locus.\n\nIf the -f option is specified, Piranha will output the model instead of the\nscored bins. Models are given in XML format, and can be loaded back into\nthe program later for scoring a new (or the same) input using the -m option. \n\n\n***************************************\n5. Simulation of input data for Piranha\n*******************************************************************************\nWe've also included a program for simulating input data - Simulate. After \nbuilding and installing, it can be found in the bin directory. This program \ncan produce simulated data from a range of distributions, both regular and \nregression based. Run it without any arguments to see its command line \noptions. As an example, to generate 1000 simulated regions where the response \nis dependent on two covariates from a Zero-truncated negative binomial \nregression distribution, you would execute the program as follows, where \u003e is\nyour prompt (here the command is split over two lines for formatting reasons,\nbut this need not be the case). \n\n\u003e ./Simulate -d ZeroTruncatedNegativeBinomialRegression -n 1000 \\\n\u003e -r response.bed -c \"cov1.bed cov2.bed\" \n\n\n*****************************\n6. Frequently asked questions\n*******************************************************************************\n\nQ. I get the error: \"Failed to split responses, smallest response accounts for \n   more than 99% of all responses. Try increasing the threshold\". What does\n   this mean? How do I fix it?\nA. Piranha assumes most bins in your input are background noise. The program\n   models this background and then tests each read count to see if it \n   significantly exceeds the background. This doesn't work if all or most of\n   your bins contain the same number of reads though. That is what this \n   message is telling you: more than 99% of the bins in your input contain\n   the same number of reads as the smallest read count (usually 1 read, but \n   not neccessarily). Most often this is because you forgot to use the -b\n   option to bin your reads and so Piranha thinks each read is its own bin.\n   \nQ. I am running Piranha with one or more covariates and I got the following\n   error (or similiar): \"ERROR: evaluating zero-truncated negative binomial \n   regression log-likelihood function with response 1 and distribution \n   parameters beta: 6000,  --- alpha: 100 failed. Reason: result was \n   non-finite\"\nA. The model fitting algorithm failed to converge. This often happens when\n   the covariate(s) contain large values, which is most often the case when\n   you provide sequencing data like RIP control IP or RNA-seq data as a\n   covariate. Try running the program again with the -l option, which\n   converts the read counts from your covariate into log-space; this \n   generally solves the problem.\n\n***************************\n7. Contacts and bug reports\n*******************************************************************************\nPhilip J. Uren\nuren@usc.edu\n\nAndrew D. Smith\nandrewds@usc.edu\n\nIf you found a bug in Piranha, we'd like to know about it. Before contacting us\nthough, please check the following list:\n\n  1.) Are you using the latest version? The bug you found may already have \n      been fixed.\n  2.) Check that your input is in the correct format and you have selected\n      the correct options.\n  3.) Please reduce your input to the smallest possible size that still \n      produces the bug; we will need your input data to reproduce the \n      problem.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmithlabcode%2Fpiranha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmithlabcode%2Fpiranha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmithlabcode%2Fpiranha/lists"}