This file is indexed.

/usr/include/libMems-1.6/libMems/FileSML.h is in libmems-1.6-dev 1.6.0+4725-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*******************************************************************************
 * $Id: FileSML.h,v 1.11 2004/03/01 02:40:08 darling Exp $
 * This file is copyright 2002-2007 Aaron Darling and authors listed in the AUTHORS file.
 * This file is licensed under the GPL.
 * Please see the file called COPYING for licensing details.
 * **************
 ******************************************************************************/

#ifndef _FileSML_h_
#define _FileSML_h_

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#pragma warning(push)
#pragma warning(disable : 4996)
#pragma warning(pop)

#include "libGenome/gnSequence.h"
#include "libMems/SortedMerList.h"
#include <boost/iostreams/device/mapped_file.hpp>
#include <fstream>
#include <vector>
#include <string>

namespace mems {

//sequence database size will be
//base_count / 4 + base_count * 12 bytes

#define DEFAULT_MEMORY_MINIMUM 20971520  //~20 Megabytes

class FileSML : public SortedMerList
{
public:
	FileSML() : SortedMerList() {
//		file_mutex = new wxMutex();
	};
	FileSML& operator=(const FileSML& sa);
	virtual FileSML* Clone() const = 0;
	
	virtual void Clear();
	
	/**
	 * Loads an existing sorted mer list from a file on disk.
	 * @param fname The name of the file to load
	 * @throws FileNotOpened thrown if the file could not be opened
	 * @throws FileUnreadable thrown if the file was corrupt or not a sorted mer list
	 */
	virtual void LoadFile(const std::string& fname);
	/**
	 * Creates large sorted mer lists which do not fit entirely in memory.
	 * BigCreate uses an external mergesort to create large sorted mer lists.
	 * It will divide the data a number of times specified by the split_levels
	 * parameter.  Each split is written to temp files on disk and merged.
	 * @param seq The sequence to create an SML for.
	 * @param split_levels The number of times to divide the sequence in half.
	 * @param mersize The size of the mers to sort on.
	 * @see FileSML::Create
	 */
	virtual void BigCreate(const genome::gnSequence& seq, const uint32 split_levels, const uint32 mersize = DNA_MER_SIZE);
	virtual void Create(const genome::gnSequence& seq, const uint64 seed );
	virtual boolean Read(std::vector<bmer>& readVector, gnSeqI size, gnSeqI offset = 0);
	virtual void Merge(SortedMerList& sa, SortedMerList& sa2);

	virtual bmer operator[]( gnSeqI index );

	virtual gnSeqI UniqueMerCount();
	virtual void SetDescription(const std::string& d);
	virtual void SetID(const sarID_t d);
	
	virtual uint32 FormatVersion();
	static uint64 MemoryMinimum();
	virtual void RadixSort(std::vector<bmer>& s_array);

	void dmCreate(const genome::gnSequence& seq, const uint64 seed);
	static void registerTempPath( const std::string& tmp_path );

	static const char* getTempPath( int pathI );

	static int getTempPathCount();
	
	const std::vector< int64 >& getUsedCoordinates() const { return seq_coords; };

protected:
	/**
	 * Reopens the sarfile fstream in read/write mode
	 * @throws FileNotOpened thrown if the file could not be opened for writing
	 */
	virtual void OpenForWriting( boolean truncate = false );
	/**
	 * Writes the SML header to disk
	 * @throws FileNotOpened thrown if the file could not be opened for writing
	 * @throws IOStreamFailed thrown if an error occurred writing the data
	 */
	virtual boolean WriteHeader();
	/**
	 * Calculates and returns the amount of memory needed to create a sorted
	 * mer list for a sequence of the specified length.
	 * @param len The length of the sequence
	 * @return The amount of memory needed in bytes.
	 */
	virtual uint64 GetNeededMemory(gnSeqI len) = 0;

	std::string filename;
	std::fstream sarfile;
	uint64 sarray_start_offset;

	boost::iostreams::mapped_file_source sardata;
	smlSeqI_t* base(){ return (smlSeqI_t*)(sardata.data()+sarray_start_offset); }
	
	static char** tmp_paths;	/**< paths to scratch disk space that can be used for an external sort */
	std::vector< int64 > seq_coords;	/**< If Ns are masked, contains coordinates of regions without Ns */
};

// versions 2 and 5 were previous
// jump to 100 to avoid confusion with DNAFileSML
inline
uint32 FileSML::FormatVersion(){
	static uint32 f_version = 100;
	return f_version;
}

inline
uint64 FileSML::MemoryMinimum(){
	static uint32 m_minimum = DEFAULT_MEMORY_MINIMUM;
	return m_minimum;
}

void maskNNNNN( const genome::gnSequence& in_seq, genome::gnSequence& out_seq, std::vector< int64 >& seq_coords, int mask_n_length );

}

#endif   //_FileSML_h_