kandi background
Explore Kits

cramtools | CRAM format specification and java API for read data | Compression library

 by   enasequence Java Version: Current License: Apache-2.0

 by   enasequence Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | cramtools Summary

cramtools is a Java library typically used in Utilities, Compression applications. cramtools has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub, Maven.
CRAMTools is a set of Java tools and APIs for efficient compression of sequence read data. Although this is intended as a stable version the code is released as early access. Parts of the CRAMTools are experimental and may not be supported in the future.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • cramtools has a low active ecosystem.
  • It has 57 star(s) with 22 fork(s). There are 18 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 45 open issues and 24 have been closed. On average issues are closed in 28 days. There are 2 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of cramtools is current.
cramtools Support
Best in #Compression
Average in #Compression
cramtools Support
Best in #Compression
Average in #Compression

quality kandi Quality

  • cramtools has 0 bugs and 0 code smells.
cramtools Quality
Best in #Compression
Average in #Compression
cramtools Quality
Best in #Compression
Average in #Compression

securitySecurity

  • cramtools has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • cramtools code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
cramtools Security
Best in #Compression
Average in #Compression
cramtools Security
Best in #Compression
Average in #Compression

license License

  • cramtools is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
cramtools License
Best in #Compression
Average in #Compression
cramtools License
Best in #Compression
Average in #Compression

buildReuse

  • cramtools releases are not available. You will need to build from source code and install.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • cramtools saves you 6820 person hours of effort in developing the same functionality from scratch.
  • It has 14144 lines of code, 843 functions and 118 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
cramtools Reuse
Best in #Compression
Average in #Compression
cramtools Reuse
Best in #Compression
Average in #Compression
Top functions reviewed by kandi - BETA

kandi has reviewed cramtools and discovered the below as its top functions. This is intended to give you an instant insight into cramtools implemented functionality, and help decide if they suit your requirements.

  • This method fixes the MD5 of the sequence md5 .
    • Get a Cigar object from the feature buffer
      • Reads data .
        • Lists all files in a given collection .
          • Sets the list of mates in a Cram record .
            • Calculate MATE annotations .
              • Splits two reads into half
                • Sets the bare mate info .
                  • Flushes the container .
                    • Find the bases for a SAMSequenceRecord .

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      cramtools Key Features

                      CRAM format specification and java API for read data.

                      cramtools Examples and Code Snippets

                      See all related Code Snippets

                      To convert a BAM file to CRAM:

                      copy iconCopydownload iconDownload
                      java -jar cramtools-3.0.jar cram \
                          --input-bam-file <bam file> \
                          --reference-fasta-file <reference fasta file> \
                          [--output-cram-file <output cram file>]
                      

                      To convert a CRAM file to BAM:

                      copy iconCopydownload iconDownload
                      java -jar cramtools-3.0.jar bam \
                          --input-cram-file <input cram file> \
                          --reference-fasta-file <reference fasta file> \
                          --output-bam-file <output bam file>
                      

                      To build the program from source:

                      copy iconCopydownload iconDownload
                      # Clone the repository to your local directory:
                      git clone https://github.com/enasequence/cramtools.git
                      
                      # Change to the directory: 
                      cd cramtools
                      
                      # Build a runnable jar file: 
                      ant -f build/build.xml runnable
                      
                      # Run cramtools
                      java -jar cramtools-3.0.jar 
                      

                      Illimuna 8-binning scheme:

                      copy iconCopydownload iconDownload
                      0, 1, 6, 6, 6, 6, 6, 6, 6, 6, 15, 15, 15, 15, 15, 15, 15, 15, 15,
                      15, 22, 22, 22, 22, 22, 27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 37,
                      37, 37, 37, 37, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
                      40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
                      40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
                      40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
                      40, 40, 40, 40, 40, 40 
                      

                      See all related Code Snippets

                      Community Discussions

                      Trending Discussions on Compression
                      • Is there any (invertible) way (in c#) to convert a string into a smaller one, and when I say smaller I mean "with reduced length"?
                      • Deflate floating point data bytes encoded as Base64
                      • How To Asynchronously Check Video File size During Transcoding Process In fluent-ffmpeg
                      • Is Shannon-Fano coding ambiguous?
                      • PowerShell reading and writing compressed files with byte arrays
                      • How to zip a file in python?
                      • Cannot extract the contents of a TGZ file using F# and SharpZipLib
                      • Nested zip contents listing
                      • Compress output raster and parallelize gdalwarp from R
                      • How to convert ZIP to GZIP in python, in-memory (AWS Lambda)
                      Trending Discussions on Compression

                      QUESTION

                      Is there any (invertible) way (in c#) to convert a string into a smaller one, and when I say smaller I mean "with reduced length"?

                      Asked 2022-Apr-16 at 07:31

                      Let me explain: in my use case a system gives me many strings that can vary in size (number of characters; length), sometimes it can be really huge! The problem is that I have to save this string in a column of a table of a "SQL Server" database, the bad news is that I am not allowed to do any migration in this database, the good news is that the column already has type nvarchar(max).

                      I've done some research before and followed the following post to write a data compressor using "Gzip" and "Brotli".

                      https://khalidabuhakmeh.com/compress-strings-with-dotnet-and-csharp

                      var value = "hello world";
                      var level = CompressionLevel.SmallestSize;
                      
                      var bytes = Encoding.Unicode.GetBytes(value);
                      await using var input = new MemoryStream(bytes);
                      await using var output = new MemoryStream();
                      
                      // GZipStream with BrotliStream
                      await using var stream = new GZipStream(output, level);
                      
                      await input.CopyToAsync(stream);
                      
                      var result = output.ToArray();
                      var resultString = Convert.ToBase64String(result);
                      

                      After implementing the conversion methods, I created tests that generate random strings of varying sizes (length) to validate the performance of the compressors, at this point I noticed the following. Both "Gzip" and "Brotli" first convert to byte[] (byte array), then apply compression, which gives a result vector (byte array) of reduced size as expected, but then converts the result (byte[]) to a base 64 string that, in 100% of the tests it has more characters (length) than the initial string.

                      My random string generator:

                      var rd_char = new Random();
                      var rd_length = new Random();
                      var wordLength = rd_length.Next(randomWordParameters.WordMinLength, randomWordParameters.WordMaxLength);
                      var sb = new StringBuilder();
                      int sourceNumber;
                      for (int i = 0; i < wordLength; i++)
                      {
                          sourceNumber = rd_char.Next(randomWordParameters.CharLowerBound, randomWordParameters.CharUpperBound);
                          sb.Append(Convert.ToChar(sourceNumber));
                      }
                      var word = sb.ToString();
                      

                      My sample strings don't exactly contain perfect representations of the cases at hand, but I believe they are good enough. Here's the string generator method, in fact it generates completely random strings in a given size range, and I used in the tests characters provided from the 33 ~ 127 values ​​passed to the Convert.ToChar() method. The strings provided by the system are in JSON format, in practice they are lists of URLs (with tens of thousands of urls), the urls usually have random sequences of characters, so I tried to generate strings as random as possible.

                      The fact is that, considering the case where I try to save in the database a string that originally (before compression) is larger than the maximum size (length) allowed in the column, when saving in the database, the "data" that goes to the column of the table in question is the result "base 64" string generated after compression and not the reduced size vector (byte array), and I believe the database will refuse the string (base 64) since its length (in the number of characters) is greater than the length of the original string.

                      So here's my question, is there any (invertible) way to convert a string into a smaller one, and when I say smaller I mean "with reduced length"? It seems that "Gzip" or "Brotli" doesn't solve the problem.

                      PS: I made sure to highlight the term "length" several times to make it clear that at that point in the text I'm talking about the number of characters and not the length in memory, because I noticed in several forums that I read before, that this confusion was making it difficult to reach conclusions.

                      ANSWER

                      Answered 2022-Apr-15 at 13:55

                      The max size for a column of type NVARCHAR(MAX) is 2 GByte of storage.

                      Since NVARCHAR uses 2 bytes per character, that's approx. 1 billion characters.

                      So I don't think you actually need to make a compression, if the problem is the performance when retrieving data, then you can use a server side caching system.

                      Source https://stackoverflow.com/questions/71884821

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install cramtools

                      To check out the source code from github you will need git client: http://git-scm.com/
                      Make sure you have java 1.7 or higher: http://openjdk.java.net/ or http://www.oracle.com/us/technologies/java/index.html
                      Make sure you have ant version 1.7 or higher: http://ant.apache.org/
                      Run the following commands

                      Support

                      CRAMTools is a set of Java tools and APIs for efficient compression of sequence read data. Although this is intended as a stable version the code is released as early access. Parts of the CRAMTools are experimental and may not be supported in the future.

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Explore Related Topics

                      Share this Page

                      share link
                      Consider Popular Compression Libraries
                      Try Top Libraries by enasequence
                      Compare Compression Libraries with Highest Support
                      Compare Compression Libraries with Highest Quality
                      Compare Compression Libraries with Highest Security
                      Compare Compression Libraries with Permissive License
                      Compare Compression Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.