Supa dups
Содержание:
Содержание
| Заголовки для www.dup-ufa.ru |
|---|
Веб-сервер
| Информация о дата-центре | |
|---|---|
| Время загрузки веб-сервера составляет 0.85 секунды | |
|
TimeWeb Ltd. AS9123 OOO TimeWeb Saint Petersburg Saint Petersburg City Russian Federation 59.8944, 30.2642 |
| Серверами доменных имён являются ns4.timeweb.org (92.53.98.42), ns1.timeweb.ru (92.53.116.200), ns2.timeweb.ru (92.53.98.100), ns3.timeweb.org (92.53.116.26). ИП адрес сайта 176.57.209.25 | |
| ИП: | 176.57.209.25 |
| Тип сервера: | nginx/1.10.1 |
| Кодировка: | UTF-8 |
| ПИНГ www.dup-ufa.ru (176.57.209.25) Размер пакета составляет 49 байт. | |
|---|---|
| 49 байт для 176.57.209.25: seq_num=1 TTL=80 | 24.6 мс |
| 49 байт для 176.57.209.25: seq_num=2 TTL=80 | 26.1 мс |
| 49 байт для 176.57.209.25: seq_num=3 TTL=80 | 24.6 мс |
| — www.dup-ufa.ru результаты пинга — | |
| 4 запроса отправлено, 4 пакета получено, 0 потеряно (0% потерь) | |
| Средний пинг до сервера составляет 18.8 мс, и среднее время загрузки сайта 0.85 секунды. |
| Конфигурация веб-сервера | |
|---|---|
| Тип содержания: | text/html; charset=utf-8 |
| Дата: | Wed, 29 Mar 2017 00:33:55 GMT |
| Ссылка: | ; rel=»https://api.w.org/» |
| Веб-сервер: | nginx/1.10.1 |
| Х-поддержка: | PHP/5.3.29 |
| Разное: | + |
| П3П: | — |
| Добавление куки: | — |
| Е-тэг: | — |
| Содержание MD5: | — |
| Штифты открытого ключа: | — |
Данные являются приблизительными*
Последнее обновление: 05.04.2017 21:10:44
Как открыть сайт dup.ru?
Самые частые причины того, что не открывается сайт dup.ru могут заключатся в следующем:
- Сайт заблокирован Вашим провайдером. Для того чтобы открыть сайт воспользуйтесь VPN сервисами.
- Вирусы переписали файл hosts. Откройте файл C:\Windows\System32\drivers\etc\hosts (Windows) или /ets/hosts (Unix) и сотрите в нем строчки связанные с сайтом dup.ru.
- Ваш антивирус или фаервол блокирует доступ к данному сайту. Попробуйте отключаить их.
- Расширение AdBlock (или другое аналогичное) блокирует содержимое сайта. Отключите плагин для данного сайта.
- Иногда проблема с недоступностью сайта заключается в ошибке браузера. Попробуйте открыть сайт dup.ru в другом браузере, например: Firefox, Chrome, Opera, Internet Explorer, Safari.
- Проблемы с DNS у Вашего провайдера.
- Проблемы на стороне провайдера.
NOTES top
The error returned by dup2() is different from that returned by
fcntl(..., F_DUPFD, ...) when newfd is out of range. On some
systems, dup2() also sometimes returns EINVAL like F_DUPFD.
If newfd was open, any errors that would have been reported at
close(2) time are lost. If this is of concern, then—unless the
program is single-threaded and does not allocate file descriptors in
signal handlers—the correct approach is not to close newfd before
calling dup2(), because of the race condition described above.
Instead, code something like the following could be used:
/* Obtain a duplicate of 'newfd' that can subsequently
be used to check for close() errors; an EBADF error
means that 'newfd' was not open. */
tmpfd = dup(newfd);
if (tmpfd == -1 && errno != EBADF) {
/* Handle unexpected dup() error */
}
/* Atomically duplicate 'oldfd' on 'newfd' */
if (dup2(oldfd, newfd) == -1) {
/* Handle dup2() error */
}
/* Now check for close() errors on the file originally
referred to by 'newfd' */
if (tmpfd != -1) {
if (close(tmpfd) == -1) {
/* Handle errors from close */
}
}
备注Remarks
_Dup和 _dup2函数将另一个文件说明符与当前打开的文件相关联。The _dup and _dup2 functions associate a second file descriptor with a currently open file. 这些函数可用于将预定义文件描述符(如用于stdout的文件)与其他文件相关联。These functions can be used to associate a predefined file descriptor, such as that for stdout, with a different file. 可以使用任一文件说明符执行针对文件的操作。Operations on the file can be carried out using either file descriptor. 文件允许的访问类型不受新说明符创建的影响。The type of access allowed for the file is unaffected by the creation of a new descriptor. _dup返回给定文件的下一个可用文件说明符。_dup returns the next available file descriptor for the given file. _dup2强制fd2引用与fd1相同的文件。_dup2 forces fd2 to refer to the same file as fd1. 如果fd2与调用时打开的文件相关联,则关闭该文件。If fd2 is associated with an open file at the time of the call, that file is closed.
_Dup和 _dup2接受文件说明符作为参数。Both _dup and _dup2 accept file descriptors as parameters. 若要将流()传递给这些函数中的任何一个,请使用_fileno。To pass a stream () to either of these functions, use _fileno. Fileno例程返回当前与给定流关联的文件描述符。The fileno routine returns the file descriptor currently associated with the given stream. 下面的示例演示如何将stderr (在 stdio.h 中定义为)与文件描述符关联:The following example shows how to associate stderr (defined as in Stdio.h) with a file descriptor:
默认情况下,此函数的全局状态的作用域限定为应用程序。By default, this function’s global state is scoped to the application. 若要更改此项,请参阅CRT 中的全局状态。To change this, see Global state in the CRT.
Решение
Дескриптор файла может быть закрыт одним из 3 способов:
- Вы явно звоните в теме.
- Процесс завершается, и операционная система автоматически закрывает каждый дескриптор файла, который все еще был открыт.
- Когда процесс вызывает один из семи функции и файловый дескриптор имеет флаг.
Как видите, в большинстве случаев файловые дескрипторы остаются открытыми, пока вы не закроете их вручную. Это то, что происходит в вашем коде тоже — так как вы не указали дескрипторы файлов не закрываются при вызове дочернего процесса , У ребенка они закрываются после того, как ребенок заканчивается. То же самое касается родителей. Если вы хотите, чтобы это произошло в любое время до завершения, вы должны вручную вызвать ,
Вот (грубое) представление о том, что делает оболочка при вводе :
- Оболочка вызывает создать новую трубу. Дескрипторы файла канала наследуются потомками на следующем шаге.
- Оболочка дважды разветвляется, давайте назовем эти процессы а также , Давайте предположим побежит а также побежит ,
- В канал чтения канала закрыт , а затем он вызывает с каналом записи трубы и чтобы написать эквивалентно записи в трубу. Затем один из семи функции вызывается, чтобы начать выполнение , пишет , но так как мы продублировали на канал записи канала, буду писать в трубу.
- В , происходит обратное: канал записи канала закрыт, а затем призван сделать указать канал чтения канала. Затем один из семи функции вызывается, чтобы начать выполнение , читает из , но так как мы стандартный ввод в канал чтения канала, буду читать из трубы.
Итак, когда вы звоните Либо одно из них верно:
- , В этом случае ничего не происходит и возвращается преждевременно. Нет файловых дескрипторов закрыты.
- , В этом случае, закрывается при необходимости, а затем сделано для ссылки на ту же запись таблицы файлов, что и , Запись таблицы файлов представляет собой структуру, которая содержит текущее смещение файла и флаги состояния файла; несколько файловых дескрипторов могут указывать на одну и ту же запись таблицы файлов, и это именно то, что происходит, когда вы дублируете файловый дескриптор. Так, имеет эффект создания а также поделиться одной и той же записи таблицы файлов. Как следствие, писать или же в конечном итоге запись в тот же файл. Таким образом, файл, который закрыт не , если ты ты закрываешь и вы делаете дескриптор файла указывает на ту же запись таблицы файлов, что и , Любая программа, которая пишет в будет вместо этого писать в файл, так как Описатель файла указывает на файл, который вы скопировали.
ОБНОВИТЬ:
Итак, для вашей конкретной проблемы, вот что я должен сказать после краткого просмотра кода:
Вы не должны звонить здесь:
Если вы закроете , вы получите ошибку в будущем, когда вы попытаетесь написать , Вот почему вы получаете , В конце концов, пишет , но вы закрыли это. К сожалению!
Вы делаете это задом наперед: вы хотите закрыть вместо. Вы открыли чтобы вы могли перенаправить в , как только перенаправление сделано, вам не нужно больше, и вы можете закрыть его. Но вы определенно не хотите закрывать потому что идея состоит в том, чтобы иметь записать в файл, на который ссылалась ,
Итак, продолжайте и сделайте это:
Обратите внимание на финал необходимо: если случайно оказывается равным Вы не хотите закрывать его по причинам, которые я только что упомянул. То же самое относится и к коду внутри : хочешь закрыть скорее, чем :
То же самое относится и к коду внутри : хочешь закрыть скорее, чем :
Это должно, по крайней мере, заставить вас работать как положено.
Что касается проблемы с трубами: ваше управление трубами на самом деле не правильно
Из кода, который вы показали, где и как не понятно и сколько каналов вы создаете, но обратите внимание, что:
- Процесс никогда не сможет читать из канала и записывать в другой канал. Например, если не является а также не является в итоге вы закрываете каналы чтения и записи (и, что еще хуже, после закрытия канала чтения вы пытаетесь продублировать его). Это никак не сработает.
- Родительский процесс закрывает каждый канал перед ожиданием завершения дочерних процессов. Это провоцирует состояние гонки.
Я предлагаю изменить способ управления трубами. В этом ответе вы можете увидеть пример работающей оболочки с открытыми контурами, работающей с трубами: https://stackoverflow.com/a/30415995/2793118
7
GereksinimlerRequirements
| YordamRoutine | Gerekli başlıkRequired header |
|---|---|
| _dup_dup | <GÇ. h><io.h> |
| _dup2_dup2 | <GÇ. h><io.h> |
Konsol Evrensel Windows Platformu (UWP) uygulamalarında desteklenmez.The console is not supported in Universal Windows Platform (UWP) apps. Console, STDIN, stdoutve stderrIle ilişkili standart akış TUTAMAÇLARı, C çalışma zamanı işlevlerinin UWP uygulamalarında kullanabilmesi için yeniden yönlendirilmelidir.The standard stream handles that are associated with the console, stdin, stdout, and stderr, must be redirected before C run-time functions can use them in UWP apps. Daha fazla uyumluluk bilgisi için bkz. Uyumluluk.For more compatibility information, see Compatibility.
Возвращаемое значениеReturn Value
_dup возвращает новый дескриптор файла._dup returns a new file descriptor. _dup2 возвращает значение 0, указывающее на успешное выполнение._dup2 returns 0 to indicate success. При возникновении ошибки каждая функция возвращает-1 и устанавливает значение значение EBADF , если дескриптор файла является недопустимым, или емфиле , если нет больше доступных дескрипторов файлов.If an error occurs, each function returns -1 and sets errno to EBADF if the file descriptor is invalid or to EMFILE if no more file descriptors are available. В случае недопустимого дескриптора файла функция также вызывает обработчик недопустимого параметра, как описано в разделе Проверка параметров.In the case of an invalid file descriptor, the function also invokes the invalid parameter handler, as described in Parameter Validation.
Дополнительные сведения об этих и других кодах возврата см. в разделе _doserrno, errno, _sys_errlist и _sys_nerr.For more information about these and other return codes, see _doserrno, errno, _sys_errlist, and _sys_nerr.
DESCRIPTION top
The dup() system call creates a copy of the file descriptor oldfd,
using the lowest-numbered unused file descriptor for the new
descriptor.
After a successful return, the old and new file descriptors may be
used interchangeably. They refer to the same open file description
(see open(2)) and thus share file offset and file status flags; for
example, if the file offset is modified by using lseek(2) on one of
the file descriptors, the offset is also changed for the other.
The two file descriptors do not share file descriptor flags (the
close-on-exec flag). The close-on-exec flag (FD_CLOEXEC; see
fcntl(2)) for the duplicate descriptor is off.
dup2()
The dup2() system call performs the same task as dup(), but instead
of using the lowest-numbered unused file descriptor, it uses the file
descriptor number specified in newfd. If the file descriptor newfd
was previously open, it is silently closed before being reused.
The steps of closing and reusing the file descriptor newfd are
performed atomically. This is important, because trying to implement
equivalent functionality using close(2) and dup() would be subject to
race conditions, whereby newfd might be reused between the two steps.
Such reuse could happen because the main program is interrupted by a
signal handler that allocates a file descriptor, or because a
parallel thread allocates a file descriptor.
Note the following points:
* If oldfd is not a valid file descriptor, then the call fails, and
newfd is not closed.
* If oldfd is a valid file descriptor, and newfd has the same value
as oldfd, then dup2() does nothing, and returns newfd.
dup3()
dup3() is the same as dup2(), except that:
* The caller can force the close-on-exec flag to be set for the new
file descriptor by specifying O_CLOEXEC in flags. See the
description of the same flag in open(2) for reasons why this may
be useful.
* If oldfd equals newfd, then dup3() fails with the error EINVAL.
Dönüş DeğeriReturn Value
_dup yeni bir dosya tanımlayıcısı döndürür._dup returns a new file descriptor. _dup2 başarıyı göstermek için 0 döndürür._dup2 returns 0 to indicate success. Bir hata oluşursa, her işlev-1 döndürür ve daha fazla dosya tanımlayıcısı yoksa, dosya tanımlayıcısı geçersizse veya Emfile için errno , EBADF olarak ayarlanır.If an error occurs, each function returns -1 and sets errno to EBADF if the file descriptor is invalid or to EMFILE if no more file descriptors are available. Geçersiz bir dosya tanımlayıcısı söz konusu olduğunda, işlev parametre doğrulamabölümünde açıklandığı gibi geçersiz parametre işleyicisini de çağırır.In the case of an invalid file descriptor, the function also invokes the invalid parameter handler, as described in Parameter Validation.
Bu ve diğer dönüş kodları hakkında daha fazla bilgi için bkz. _doserrno, errno, _sys_errlist ve _sys_nerr.For more information about these and other return codes, see _doserrno, errno, _sys_errlist, and _sys_nerr.
Usage (Only tested on farm)
Step 2. Modify the configuration file manually (optional).
configuration file is in json format, it has all the information required by run_purge_dups.py. Here is an example of a configuration file.
This file use several key words to define resource allocation, input files or output files, they are listed as follows.
- core: CPU number
- skip: Bool value set to skip this job
- prefix: Output file prefix
- fofn: Sequencing files list
- mem: Maximum amount of RAM in MB
- tmpdir: Temporary directory
- lineage: Busco database
- queue: job queue
- ref: Assembly file path
- out_dir: Working directory
- ispb: Bool value set for pacbio data, 0 for Illumina data
Notice: isdip is deprecated.
The dictionary «kcp» keeps paramaters for run_kcm script.
The dictionary «gs» sets parameters for get_seqs (purge_dups executable file), designed to produce primary contigs and haplotigs.
The dictionary «pd» sets parameters for purge_dups (purge_dups executable file), designed to purge haplotigs and overlaps in an assembly.
The dictionary «cc» sets parameters for minimap2/bwa.
The dictionary «sa» sets parameters for minimap2.
The dictionary «busco» sets parameters for run_busco.
Step 3. Use run_purge_dups.py to run the pipeline
After the pipeline is finished, there will be four new directories in the working directory (set in the configuration file).
- coverage: coverage cutoffs, coverage histogram and base-level coverage files
- split_aln: segmented assembly file and a self-alignment paf file.
- purge_dups: duplicate sequence list.
- seqs: purged primary contigs ending with .purge.fa and haplotigs ending with .red.fa, also K-mer comparison plot and busco results are also in this directory.
Other Modification
If the busco and k-mer comparison plot scripts are working, please modify them with the following instructions.
- run_busco: set the PATH variables in run_busco script to your own related path.
- run_kcm: set kcm_dir variable in run_kcm script to your own KMC directory path.
NOTES top
The error returned by dup2() is different from that returned by
fcntl(..., F_DUPFD, ...) when newfd is out of range. On some
systems, dup2() also sometimes returns EINVAL like F_DUPFD.
If newfd was open, any errors that would have been reported at
close(2) time are lost. If this is of concern, then—unless the
program is single-threaded and does not allocate file descriptors in
signal handlers—the correct approach is not to close newfd before
calling dup2(), because of the race condition described above.
Instead, code something like the following could be used:
/* Obtain a duplicate of 'newfd' that can subsequently
be used to check for close() errors; an EBADF error
means that 'newfd' was not open. */
tmpfd = dup(newfd);
if (tmpfd == -1 && errno != EBADF) {
/* Handle unexpected dup() error */
}
/* Atomically duplicate 'oldfd' on 'newfd' */
if (dup2(oldfd, newfd) == -1) {
/* Handle dup2() error */
}
/* Now check for close() errors on the file originally
referred to by 'newfd' */
if (tmpfd != -1) {
if (close(tmpfd) == -1) {
/* Handle errors from close */
}
}
DESCRIPTION top
The dup() system call creates a copy of the file descriptor oldfd,
using the lowest-numbered unused file descriptor for the new
descriptor.
After a successful return, the old and new file descriptors may be
used interchangeably. They refer to the same open file description
(see open(2)) and thus share file offset and file status flags; for
example, if the file offset is modified by using lseek(2) on one of
the file descriptors, the offset is also changed for the other.
The two file descriptors do not share file descriptor flags (the
close-on-exec flag). The close-on-exec flag (FD_CLOEXEC; see
fcntl(2)) for the duplicate descriptor is off.
dup2()
The dup2() system call performs the same task as dup(), but instead
of using the lowest-numbered unused file descriptor, it uses the file
descriptor number specified in newfd. If the file descriptor newfd
was previously open, it is silently closed before being reused.
The steps of closing and reusing the file descriptor newfd are
performed atomically. This is important, because trying to implement
equivalent functionality using close(2) and dup() would be subject to
race conditions, whereby newfd might be reused between the two steps.
Such reuse could happen because the main program is interrupted by a
signal handler that allocates a file descriptor, or because a
parallel thread allocates a file descriptor.
Note the following points:
* If oldfd is not a valid file descriptor, then the call fails, and
newfd is not closed.
* If oldfd is a valid file descriptor, and newfd has the same value
as oldfd, then dup2() does nothing, and returns newfd.
dup3()
dup3() is the same as dup2(), except that:
* The caller can force the close-on-exec flag to be set for the new
file descriptor by specifying O_CLOEXEC in flags. See the
description of the same flag in open(2) for reasons why this may
be useful.
* If oldfd equals newfd, then dup3() fails with the error EINVAL.
Саундтреки
Из фильма В центре вниманияИз фильма Ван ХельсингИз сериала Дневники ВампираИз фильма Скауты против зомбииз фильмов ‘Миссия невыполнима’Из фильма Голодные игры: Сойка-пересмешница. Часть 2OST ‘Свет в океане’OST «Большой и добрый великан»из фильма ‘Новогодний корпоратив’из фильма ‘Список Шиндлера’ OST ‘Перевозчик’Из фильма Книга джунглейиз сериала ‘Метод’Из фильма ТелохранительИз сериала Изменыиз фильма Мистериум. Тьма в бутылкеиз фильма ‘Пассажиры’из фильма ТишинаИз сериала Кухня. 6 сезониз фильма ‘Расплата’ Из фильма Человек-муравейиз фильма ПриглашениеИз фильма Бегущий в лабиринте 2из фильма ‘Молот’из фильма ‘Инкарнация’Из фильма Савва. Сердце воинаИз сериала Легко ли быть молодымиз сериала ‘Ольга’Из сериала Хроники ШаннарыИз фильма Самый лучший деньИз фильма Соседи. На тропе войныМузыка из сериала «Остров»Из фильма ЙоганутыеИз фильма ПреступникИз сериала СверхестественноеИз сериала Сладкая жизньИз фильма Голограмма для короляИз фильма Первый мститель: ПротивостояниеИз фильма КостиИз фильма Любовь не по размеруOST ‘Глубоководный горизонт’Из фильма Перепискаиз фильма ‘Призрачная красота’Место встречи изменить нельзяOST «Гений»из фильма ‘Красотка’Из фильма Алиса в ЗазеркальеИз фильма 1+1 (Неприкасаемые)Из фильма До встречи с тобойиз фильма ‘Скрытые фигуры’из фильма Призывиз сериала ‘Мир Дикого Запада’из игр серии ‘Bioshock’ Музыка из аниме «Темный дворецкий»из фильма ‘Американская пастораль’Из фильма Тарзан. ЛегендаИз фильма Красавица и чудовище ‘Искусственный интеллект. Доступ неограничен»Люди в черном 3’из фильма ‘Планетариум’Из фильма ПрогулкаИз сериала ЧужестранкаИз сериала Элементарноиз сериала ‘Обратная сторона Луны’Из фильма ВаркрафтИз фильма Громче, чем бомбыиз мультфильма ‘Зверопой’Из фильма БруклинИз фильма Игра на понижениеИз фильма Зачарованнаяиз фильма РазрушениеOST «Полный расколбас»OST «Свободный штат Джонса»OST И гаснет светИз сериала СолдатыИз сериала Крыша мираИз фильма Неоновый демонИз фильма Москва никогда не спитИз фильма Джейн берет ружьеИз фильма Стражи галактикииз фильма ‘Sos, дед мороз или все сбудется’OST ‘Дом странных детей Мисс Перегрин’Из игры Contact WarsИз Фильма АмелиИз фильма Иллюзия обмана 2OST Ледниковый период 5: Столкновение неизбежноИз фильма Из тьмыИз фильма Колония Дигнидадиз фильма ‘Страна чудес’Музыка из сериала ‘Цвет черёмухи’Из фильма Образцовый самец 2из фильмов про Гарри Поттера Из фильма Дивергент, глава 3: За стеной из мультфильма ‘Монстр в Париже’из мультфильма ‘Аисты’Из фильма КоробкаИз фильма СомнияИз сериала Ходячие мертвецыИз фильма ВыборИз сериала Королек — птичка певчаяДень независимости 2: ВозрождениеИз сериала Великолепный векиз фильма ‘Полтора шпиона’из фильма Светская жизньИз сериала Острые козырьки
AçıklamalarRemarks
_Dup ve _dup2 işlevleri, bir ikinci dosya tanımlayıcısını Şu anda açık olan bir dosya ile ilişkilendirir.The _dup and _dup2 functions associate a second file descriptor with a currently open file. Bu işlevler, stdoutgibi önceden tanımlanmış bir dosya tanımlayıcısını farklı bir dosyayla ilişkilendirmek için kullanılabilir.These functions can be used to associate a predefined file descriptor, such as that for stdout, with a different file. Dosyadaki işlemler, herhangi bir dosya tanımlayıcısı kullanılarak gerçekleştirilebilir.Operations on the file can be carried out using either file descriptor. Dosya için izin verilen erişim türü, yeni bir tanımlayıcının oluşturulmasından etkilenmez.The type of access allowed for the file is unaffected by the creation of a new descriptor. _dup , belirtilen dosya için bir sonraki kullanılabilir dosya tanımlayıcısını döndürür._dup returns the next available file descriptor for the given file. _dup2 fd2 , FD1ile aynı dosyaya başvurmaya zorlar._dup2 forces fd2 to refer to the same file as fd1. Fd2 , çağrı sırasında açık bir dosya ile ilişkiliyse, bu dosya kapatılır.If fd2 is associated with an open file at the time of the call, that file is closed.
Hem _dup hem de _dup2 dosya tanımlayıcılarını parametre olarak kabul eder.Both _dup and _dup2 accept file descriptors as parameters. Bu işlevlerden birine bir Stream() geçirmek için _filenokullanın.To pass a stream () to either of these functions, use _fileno. Fileno yordamı, belirtilen akış ile Şu anda ilişkili dosya tanımlayıcısını döndürür.The fileno routine returns the file descriptor currently associated with the given stream. Aşağıdaki örnek, stderr ‘In (stdio. h ‘de olarak tanımlanır) bir dosya tanımlayıcısıyla nasıl ilişkilendirileceğini gösterir:The following example shows how to associate stderr (defined as in Stdio.h) with a file descriptor:
Varsayılan olarak, bu işlevin genel durumu uygulamanın kapsamına alınır.By default, this function’s global state is scoped to the application. Bunu değiştirmek için bkz. CRT Içindeki genel durum.To change this, see Global state in the CRT.
Аренда
F_SETLEASEF_GETLEASEfdopentruncate
- F_SETLEASE (int)
-
Установить или удалить аренду файла, в соответствии со значениями,
указываемыми в arg:-
- F_RDLCK
-
Установить аренду чтения. Это приведёт к генерации уведомления вызывающего
процесса, когда файл открывается для записи или усечения. Аренда чтения
может быть выделена только на файловый дескриптор, открытый только на
чтение. - F_WRLCK
-
Установить аренду записи. Это приведёт к генерации уведомления вызывающего
процесса, когда файл открывается для чтения или записи или выполняется его
усечение. Аренда записи может быть установлена на файл, только если этот
файл не имеет других открытых файловых дескрипторов. - F_UNLCK
- Удалить аренду с указанного файла.
-
Аренды ассоциируются с открытым файловым описанием (см. open(2)). Это
значит, что дублированные файловые дескрипторы (созданные, например,
fork(2) или dup(2)) указывают на одну и ту же аренду, и эта аренда
может изменяться или освобождаться через любой из этих дескрипторов. Более
того, аренда освобождается или через явную команду F_UNLCK на любом из
этих дублированных файловых дескрипторов, или когда все эти файловые
дескрипторы будут закрыты.
Аренды могут быть выданы только на обычные файлы. Непривилегированный
процесс может получить аренду только на файл, чей UID (владельца) совпадает
с UID на файловой системе процесса. Процесс с мандатом CAP_LEASE может
получить аренду на любые файлы.
- F_GETLEASE (void)
-
Узнать какой тип аренды ассоциирован с файловым дескриптором fd;
возвращается одно из значений F_RDLCK, F_WRLCK или F_UNLCK,
соответственно означающих аренду на чтение, запись или что аренды
нет. Аргумент arg игнорируется.
Когда процесс («нарушителя аренды») выполняет вызов open(2) или
truncate(2), который конфликтует с арендой, установленной через
F_SETLEASE, то системный вызов блокируется ядром и ядро уведомляет
арендатора сигналом (по умолчанию SIGIO). Арендатор должен при получении
этого сигнала выполнить все необходимые действия по очистке для подготовки
этого файла к использованию другим процессом (например, сбросить буферы
кэша) и затем удалить или снизить условия аренды. Аренда удаляется по
команде F_SETLEASE с аргументом arg, установленным в F_UNLCK. Если
арендатор удерживает аренду на запись в файл, и нарушитель аренды открывает
файл на чтение, то достаточно того, что арендатор понизит условия аренды до
аренды на чтение. Это выполняется командой F_SETLEASE с аргументом
arg, установленным в F_RDLCK.
Если арендатор не освободит аренду или не снизит условия в течении
определённого количества секунд, указанного в файле
/proc/sys/fs/lease-break-time, то ядро принудительно удалит или снизит
условия аренды для арендатора.
После того, как был начат разрыв аренды, F_GETLEASE возвращает тип
назначения аренды (или F_RDLCK или F_UNLCK, в зависимости от
необходимости совместимости с нарушителем аренды) до тех пор, пока держатель
аренды добровольно не отдаст или не удалит аренду или ядро принудительно не
сделает это после истечения таймера разрыва аренды.
После того как аренда снята держателем аренды или принудительно удалена и
снижены условия, и предполагая, что нарушитель аренды не выполнял
неблокирующий системный вызов, ядро позволяет продолжить работу системного
вызова нарушителя аренды.
Если нарушитель аренды, заблокированный в open(2) или truncate(2),
прерывается обработчиком сигнала, то системный вызов завершается неудачно с
ошибкой EINTR, но другие шаги по-прежнему выполняются как описано
ранее. Если нарушитель аренды завершается по сигналу будучи блокированным в
open(2) или truncate(2), то другие шаги по-прежнему выполняются как
описано ранее. Если нарушитель аренды указал флаг O_NONBLOCK при вызове
open(2), то вызов немедленно завершается неудачей с ошибкой
EWOULDBLOCK, но другие шаги по-прежнему выполняются как описано ранее.
FAQ
Q: Can I use purge_dups with short reads?
A: Yes, purge_dups does have a program to process Illumina reads, it’s called ngscstat under the bin directory. But I have not got time to test it. If you want to play with it, please follow this workflow:
After you get the TX.stat and TX.base.cov file, you can following the normal purge_dups routine to clean your assembly.
Q1: Can I validate the cutoffs used by purge_dups?
A1: Yes, we also recommend this step. A script «hist_plot.py» under the scripts directory is available, you can also use it to manually select the cutoffs.
Q2: How can I validate the purged assembly? Is it clean enough or overpurged?
A2: There are many ways to validate the purged assembly. One way is to make a coverage plot for it which can also be hist_plot.py, the 2nd way is to run BUSCO and another way is to make a KAT plot with KAT (https://github.com/TGAC/KAT) or KMC (https://github.com/dfguan/KMC, use this if you only have a small memory machine) if short reads or some accurate reads are available.
Q3: Why do I get much fewer haplotypic duplications than expected?
A3: First check the original contig names, they should not contain any colons. Then check the cutoffs, if purge_dups automatically use a fairly low read depth for haplotypic duplications, it may remove nothing. In this case, you need to set the cutoffs manually.
Q4: why does purge_dups remove middle sequence in a contig?
A4: Some of them are real, while others may not. We are currently investigating them. Please use for command if you only want to remove the duplications at the ends of the contigs.